Coverage Report

Created: 2025-02-21 07:11

/rust/registry/src/index.crates.io-6f17d22bba15001f/futures-task-0.3.31/src/arc_wake.rs
Line
Count
Source
1
use alloc::sync::Arc;
2
3
/// A way of waking up a specific task.
4
///
5
/// By implementing this trait, types that are expected to be wrapped in an `Arc`
6
/// can be converted into [`Waker`] objects.
7
/// Those Wakers can be used to signal executors that a task it owns
8
/// is ready to be `poll`ed again.
9
///
10
/// Currently, there are two ways to convert `ArcWake` into [`Waker`]:
11
///
12
/// * [`waker`](super::waker()) converts `Arc<impl ArcWake>` into [`Waker`].
13
/// * [`waker_ref`](super::waker_ref()) converts `&Arc<impl ArcWake>` into [`WakerRef`] that
14
///   provides access to a [`&Waker`][`Waker`].
15
///
16
/// [`Waker`]: std::task::Waker
17
/// [`WakerRef`]: super::WakerRef
18
// Note: Send + Sync required because `Arc<T>` doesn't automatically imply
19
// those bounds, but `Waker` implements them.
20
pub trait ArcWake: Send + Sync {
21
    /// Indicates that the associated task is ready to make progress and should
22
    /// be `poll`ed.
23
    ///
24
    /// This function can be called from an arbitrary thread, including threads which
25
    /// did not create the `ArcWake` based [`Waker`].
26
    ///
27
    /// Executors generally maintain a queue of "ready" tasks; `wake` should place
28
    /// the associated task onto this queue.
29
    ///
30
    /// [`Waker`]: std::task::Waker
31
65
    fn wake(self: Arc<Self>) {
32
65
        Self::wake_by_ref(&self)
33
65
    }
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::stream::into_future::StreamFuture<surrealdb::api::method::live::Stream<surrealdb::api::value::Value>>> as futures_task::arc_wake::ArcWake>::wake
<futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<reblessive::tree::future::ScopeStkFuture<core::result::Result<surrealdb_core::sql::value::value::Value, surrealdb_core::err::Error>>>>> as futures_task::arc_wake::ArcWake>::wake
Line
Count
Source
31
65
    fn wake(self: Arc<Self>) {
32
65
        Self::wake_by_ref(&self)
33
65
    }
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<reblessive::tree::future::ScopeStkFuture<core::result::Result<(), surrealdb_core::err::Error>>>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<<surrealdb_core::idx::trees::store::lru::ConcurrentLru<alloc::sync::Arc<surrealdb_core::idx::trees::store::StoredNode<surrealdb_core::idx::trees::btree::BTreeNode<surrealdb_core::idx::trees::bkeys::FstKeys>>>>>::duplicate<<surrealdb_core::idx::trees::store::cache::TreeLruCache<surrealdb_core::idx::trees::btree::BTreeNode<surrealdb_core::idx::trees::bkeys::FstKeys>>>::next_generation::{closure#0}::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<<surrealdb_core::idx::trees::store::lru::ConcurrentLru<alloc::sync::Arc<surrealdb_core::idx::trees::store::StoredNode<surrealdb_core::idx::trees::btree::BTreeNode<surrealdb_core::idx::trees::bkeys::TrieKeys>>>>>::duplicate<<surrealdb_core::idx::trees::store::cache::TreeLruCache<surrealdb_core::idx::trees::btree::BTreeNode<surrealdb_core::idx::trees::bkeys::TrieKeys>>>::next_generation::{closure#0}::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<<surrealdb_core::idx::trees::store::lru::ConcurrentLru<alloc::sync::Arc<surrealdb_core::idx::trees::store::StoredNode<surrealdb_core::idx::trees::mtree::MTreeNode>>>>::duplicate<<surrealdb_core::idx::trees::store::cache::TreeLruCache<surrealdb_core::idx::trees::mtree::MTreeNode>>::next_generation::{closure#0}::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<core::pin::Pin<alloc::boxed::Box<dyn core::future::future::Future<Output = core::result::Result<(async_graphql_value::Name, async_graphql_value::ConstValue), async_graphql::error::ServerError>> + core::marker::Send>>>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<async_graphql::resolver_utils::list::resolve_list<&async_graphql::model::enum_value::__EnumValue, &alloc::vec::Vec<async_graphql::model::enum_value::__EnumValue>>::{closure#0}::{closure#0}>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<async_graphql::resolver_utils::list::resolve_list<&async_graphql::model::enum_value::__EnumValue, &alloc::vec::Vec<async_graphql::model::enum_value::__EnumValue>>::{closure#0}::{closure#1}>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<async_graphql::resolver_utils::list::resolve_list<&async_graphql::model::input_value::__InputValue, &alloc::vec::Vec<async_graphql::model::input_value::__InputValue>>::{closure#0}::{closure#0}>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<async_graphql::resolver_utils::list::resolve_list<&async_graphql::model::input_value::__InputValue, &alloc::vec::Vec<async_graphql::model::input_value::__InputValue>>::{closure#0}::{closure#1}>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<async_graphql::resolver_utils::list::resolve_list<&async_graphql::model::type::__Type, &alloc::vec::Vec<async_graphql::model::type::__Type>>::{closure#0}::{closure#0}>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<async_graphql::resolver_utils::list::resolve_list<&async_graphql::model::type::__Type, &alloc::vec::Vec<async_graphql::model::type::__Type>>::{closure#0}::{closure#1}>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<async_graphql::resolver_utils::list::resolve_list<&async_graphql::model::field::__Field, &alloc::vec::Vec<async_graphql::model::field::__Field>>::{closure#0}::{closure#0}>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<async_graphql::resolver_utils::list::resolve_list<&async_graphql::model::field::__Field, &alloc::vec::Vec<async_graphql::model::field::__Field>>::{closure#0}::{closure#1}>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<async_graphql::resolver_utils::list::resolve_list<&async_graphql::model::directive::__Directive, &alloc::vec::Vec<async_graphql::model::directive::__Directive>>::{closure#0}::{closure#0}>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<async_graphql::resolver_utils::list::resolve_list<&async_graphql::model::directive::__Directive, &alloc::vec::Vec<async_graphql::model::directive::__Directive>>::{closure#0}::{closure#1}>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<async_graphql::resolver_utils::list::resolve_list<&async_graphql::model::directive::__DirectiveLocation, &alloc::vec::Vec<async_graphql::model::directive::__DirectiveLocation>>::{closure#0}::{closure#0}>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<async_graphql::resolver_utils::list::resolve_list<&async_graphql::model::directive::__DirectiveLocation, &alloc::vec::Vec<async_graphql::model::directive::__DirectiveLocation>>::{closure#0}::{closure#1}>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<futures_util::future::try_future::into_future::IntoFuture<async_graphql::dynamic::resolve::resolve_list::{closure#0}::{closure#0}>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::stream::into_future::StreamFuture<core::pin::Pin<alloc::boxed::Box<dyn futures_core::stream::Stream<Item = async_graphql::response::Response> + core::marker::Send>>>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<<object_store::local::LocalFileSystem as object_store::ObjectStore>::delete_stream::{closure#0}::{closure#0}>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_util::stream::futures_ordered::OrderWrapper<<object_store::memory::InMemory as object_store::ObjectStore>::delete_stream::{closure#0}::{closure#0}>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_executor::local_pool::ThreadNotify as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <futures_util::stream::futures_unordered::task::Task<futures_task::future_obj::LocalFutureObj<()>> as futures_task::arc_wake::ArcWake>::wake
Unexecuted instantiation: <_ as futures_task::arc_wake::ArcWake>::wake
34
35
    /// Indicates that the associated task is ready to make progress and should
36
    /// be `poll`ed.
37
    ///
38
    /// This function can be called from an arbitrary thread, including threads which
39
    /// did not create the `ArcWake` based [`Waker`].
40
    ///
41
    /// Executors generally maintain a queue of "ready" tasks; `wake_by_ref` should place
42
    /// the associated task onto this queue.
43
    ///
44
    /// This function is similar to [`wake`](ArcWake::wake), but must not consume the provided data
45
    /// pointer.
46
    ///
47
    /// [`Waker`]: std::task::Waker
48
    fn wake_by_ref(arc_self: &Arc<Self>);
49
}