Use futures-core and futures-tasks via futures-util.
Just to reduce number of dependencies.
This commit is contained in:
parent
6dee339783
commit
e0224ab159
|
@ -35,7 +35,7 @@ luau = ["ffi/luau"]
|
|||
luau-jit = ["luau", "ffi/luau-codegen"]
|
||||
vendored = ["ffi/vendored"]
|
||||
module = ["mlua_derive", "ffi/module"]
|
||||
async = ["futures-core", "futures-task", "futures-util"]
|
||||
async = ["futures-util"]
|
||||
send = []
|
||||
serialize = ["serde", "erased-serde", "serde-value"]
|
||||
macros = ["mlua_derive/macros"]
|
||||
|
@ -47,9 +47,7 @@ bstr = { version = "1.0", features = ["std"], default_features = false }
|
|||
once_cell = { version = "1.0" }
|
||||
num-traits = { version = "0.2.14" }
|
||||
rustc-hash = "1.0"
|
||||
futures-core = { version = "0.3.5", optional = true }
|
||||
futures-task = { version = "0.3.5", optional = true }
|
||||
futures-util = { version = "0.3.5", optional = true }
|
||||
futures-util = { version = "0.3", optional = true, default-features = false, features = ["std"] }
|
||||
serde = { version = "1.0", optional = true }
|
||||
erased-serde = { version = "0.3", optional = true }
|
||||
serde-value = { version = "0.7", optional = true }
|
||||
|
|
|
@ -11,7 +11,7 @@ use crate::lua::Lua;
|
|||
use crate::value::{FromLuaMulti, IntoLua, IntoLuaMulti, Value};
|
||||
|
||||
#[cfg(feature = "async")]
|
||||
use {futures_core::future::LocalBoxFuture, futures_util::future};
|
||||
use futures_util::future::{self, LocalBoxFuture};
|
||||
|
||||
/// Trait for types [loadable by Lua] and convertible to a [`Chunk`]
|
||||
///
|
||||
|
|
|
@ -16,8 +16,7 @@ use crate::value::{FromLuaMulti, IntoLua, IntoLuaMulti};
|
|||
#[cfg(feature = "async")]
|
||||
use {
|
||||
crate::types::AsyncCallback,
|
||||
futures_core::future::{Future, LocalBoxFuture},
|
||||
futures_util::{future, TryFutureExt},
|
||||
futures_util::future::{self, Future, LocalBoxFuture, TryFutureExt},
|
||||
};
|
||||
|
||||
/// Handle to an internal Lua function.
|
||||
|
|
|
@ -54,12 +54,8 @@ use crate::{chunk::Compiler, types::VmState};
|
|||
#[cfg(feature = "async")]
|
||||
use {
|
||||
crate::types::{AsyncCallback, AsyncCallbackUpvalue, AsyncPollUpvalue},
|
||||
futures_task::noop_waker_ref,
|
||||
futures_util::future::{self, TryFutureExt},
|
||||
std::{
|
||||
future::Future,
|
||||
task::{Context, Poll, Waker},
|
||||
},
|
||||
futures_util::future::{self, Future, TryFutureExt},
|
||||
futures_util::task::{noop_waker_ref, Context, Poll, Waker},
|
||||
};
|
||||
|
||||
#[cfg(feature = "serialize")]
|
||||
|
|
|
@ -24,7 +24,7 @@ use crate::value::{FromLua, FromLuaMulti, IntoLua, IntoLuaMulti, MultiValue, Val
|
|||
use crate::userdata::USER_VALUE_MAXSLOT;
|
||||
|
||||
#[cfg(feature = "async")]
|
||||
use futures_core::future::Future;
|
||||
use std::future::Future;
|
||||
|
||||
/// Constructed by the [`Lua::scope`] method, allows temporarily creating Lua userdata and
|
||||
/// callbacks that are not required to be Send or 'static.
|
||||
|
|
|
@ -18,7 +18,7 @@ use crate::util::{assert_stack, check_stack, StackGuard};
|
|||
use crate::value::{FromLua, FromLuaMulti, IntoLua, IntoLuaMulti, Nil, Value};
|
||||
|
||||
#[cfg(feature = "async")]
|
||||
use {futures_core::future::LocalBoxFuture, futures_util::future};
|
||||
use futures_util::future::{self, LocalBoxFuture};
|
||||
|
||||
/// Handle to an internal Lua table.
|
||||
#[derive(Clone)]
|
||||
|
|
|
@ -27,8 +27,9 @@ use {
|
|||
lua::ASYNC_POLL_PENDING,
|
||||
value::{MultiValue, Value},
|
||||
},
|
||||
futures_core::{future::Future, stream::Stream},
|
||||
futures_util::stream::Stream,
|
||||
std::{
|
||||
future::Future,
|
||||
marker::PhantomData,
|
||||
pin::Pin,
|
||||
ptr::NonNull,
|
||||
|
|
|
@ -9,7 +9,7 @@ use std::{fmt, mem, ptr};
|
|||
use std::ffi::CStr;
|
||||
|
||||
#[cfg(feature = "async")]
|
||||
use futures_core::future::LocalBoxFuture;
|
||||
use futures_util::future::LocalBoxFuture;
|
||||
|
||||
use crate::error::Result;
|
||||
#[cfg(not(feature = "luau"))]
|
||||
|
|
|
@ -4,7 +4,7 @@ use crate::userdata::{AnyUserData, MetaMethod};
|
|||
use crate::value::{FromLua, FromLuaMulti, IntoLua, IntoLuaMulti, Value};
|
||||
|
||||
#[cfg(feature = "async")]
|
||||
use {futures_core::future::LocalBoxFuture, futures_util::future};
|
||||
use futures_util::future::{self, LocalBoxFuture};
|
||||
|
||||
/// An extension trait for [`AnyUserData`] that provides a variety of convenient functionality.
|
||||
pub trait AnyUserDataExt<'lua>: Sealed {
|
||||
|
|
Loading…
Reference in New Issue