pub struct Token(/* private fields */);Expand description
Token is a type that is used to associate blocking work with itself and configure
AdaptiveFuture’s.
A token to configure and track wall-times for work in AdaptiveFuture’s
Implementations§
Source§impl Token
impl Token
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new unique Token, either to use a static or a one-off.
This Token is configured to start out work as
inline in the poll implementation, and to adaptively switch to spawning.
Sourcepub fn always_inline() -> Self
pub fn always_inline() -> Self
Create a new Token that tells an AdaptiveFuture to
always inline its work into its poll implementation.
Sourcepub fn always_spawn() -> Self
pub fn always_spawn() -> Self
Create a new Token that tells an AdaptiveFuture to
always move its work onto a thread.
Trait Implementations§
impl Copy for Token
impl Eq for Token
impl StructuralPartialEq for Token
Auto Trait Implementations§
impl Freeze for Token
impl RefUnwindSafe for Token
impl Send for Token
impl Sync for Token
impl Unpin for Token
impl UnwindSafe for Token
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more