Struct ContextBuilder
pub struct ContextBuilder<'a> { pub(in ::task::wake) waker: &'a Waker, pub(in ::task::wake) local_waker: &'a LocalWaker, pub(in ::task::wake) ext: ExtData<'a>, pub(in ::task::wake) _marker: PhantomData<fn(&'a ()) -> &'a ()>, pub(in ::task::wake) _marker2: PhantomData<*mut ()> }
A Builder used to construct a Context instance
with support for LocalWaker.
Examples
use ;
use Future;
let local_waker = noop;
let waker = noop;
let mut cx = from_waker
.local_waker
.build;
let mut future = pin!;
let poll = future.as_mut.poll;
assert_eq!;
Fields
waker: &'a Wakerlocal_waker: &'a LocalWakerext: ExtData<'a>_marker: PhantomData<fn(&'a ()) -> &'a ()>_marker2: PhantomData<*mut ()>
Implementations
impl<'a> ContextBuilder<'a>
const fn from_waker(waker: &'a Waker) -> SelfCreates a ContextBuilder from a Waker.
const fn from(cx: &'a mut Context<'_>) -> SelfCreates a ContextBuilder from an existing Context.
const fn waker(self, waker: &'a Waker) -> SelfSets the value for the waker on
Context.const fn local_waker(self, local_waker: &'a LocalWaker) -> SelfSets the value for the local waker on
Context.const fn ext(self, data: &'a mut dyn Any) -> SelfSets the value for the extension data on
Context.const fn build(self) -> Context<'a>Builds the
Context.
Trait Implementations
impl<'a> Debug for ContextBuilder<'a>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<'a> !RefUnwindSafe for ContextBuilder<'a>
impl<'a> !Send for ContextBuilder<'a>
impl<'a> !Sync for ContextBuilder<'a>
impl<'a> !UnwindSafe for ContextBuilder<'a>
impl<'a> Freeze for ContextBuilder<'a>
impl<'a> Unpin for ContextBuilder<'a>
impl<'a> UnsafeUnpin for ContextBuilder<'a>
Blanket Implementations
impl<T> Any for ContextBuilder<'a>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for ContextBuilder<'a>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for ContextBuilder<'a>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for ContextBuilder<'a>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for ContextBuilder<'a>
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for ContextBuilder<'a>
impl<T, U> Into<U> for ContextBuilder<'a>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for ContextBuilder<'a>
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for ContextBuilder<'a>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>