pub trait Context<'ctx>: Sized + Sealed<'ctx> {
type Merged<Other: Context<'ctx>>: Context<'ctx>;
// Required methods
fn from_task<'s>(task_ctx: &'s mut Context<'ctx>) -> &'s mut Self;
fn unmerge_self<'s, Other: Context<'ctx>>(
merged: &'s mut Self::Merged<Other>,
) -> &'s mut Self;
fn unmerge_other<'s, Other: Context<'ctx>>(
merged: &'s mut Self::Merged<Other>,
) -> &'s mut Other;
}Expand description
Context trait for pull-based streams, allowing operators to be generic over
synchronous (()) and asynchronous (core::task::Context) execution contexts.
Required Associated Types§
Required Methods§
Sourcefn from_task<'s>(task_ctx: &'s mut Context<'ctx>) -> &'s mut Self
fn from_task<'s>(task_ctx: &'s mut Context<'ctx>) -> &'s mut Self
Creates a context reference from a core::task::Context.
Sourcefn unmerge_self<'s, Other: Context<'ctx>>(
merged: &'s mut Self::Merged<Other>,
) -> &'s mut Self
fn unmerge_self<'s, Other: Context<'ctx>>( merged: &'s mut Self::Merged<Other>, ) -> &'s mut Self
Extracts the self-side context from a merged context.
Sourcefn unmerge_other<'s, Other: Context<'ctx>>(
merged: &'s mut Self::Merged<Other>,
) -> &'s mut Other
fn unmerge_other<'s, Other: Context<'ctx>>( merged: &'s mut Self::Merged<Other>, ) -> &'s mut Other
Extracts the other-side context from a merged context.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.