pub struct CompletionToken(/* private fields */);Expand description
Token for listening for responses to requests
These tokens are always guaranteed, to have at most one equal counterpart, and they are
deliberately not Cloneable or Copyable to help enforce that constraint.
Internally, the token contains a u64 sourced from an incrementing atomic, no guarantees are
made about iteration order, and the tokens have no meaning across executions.
Implementations§
Source§impl CompletionToken
impl CompletionToken
Sourcepub fn new() -> (CompletionToken, CompletionToken)
pub fn new() -> (CompletionToken, CompletionToken)
Creates a pair of equal CompletionTokens
It is guaranteed that no previous or future pair of CompletionTokens, at least within a
single execution of the program, will be equal to these tokens
Sourcepub fn count(&self) -> usize
pub fn count(&self) -> usize
Returns the number of copies of this CompletionToken currently alive
This is used for doing “Garbage Collection” of token’s whose partners have been dropped.
Trait Implementations§
Source§impl Debug for CompletionToken
impl Debug for CompletionToken
Source§impl Hash for CompletionToken
impl Hash for CompletionToken
Source§impl Ord for CompletionToken
impl Ord for CompletionToken
Source§fn cmp(&self, other: &CompletionToken) -> Ordering
fn cmp(&self, other: &CompletionToken) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CompletionToken
impl PartialEq for CompletionToken
Source§impl PartialOrd for CompletionToken
impl PartialOrd for CompletionToken
impl Eq for CompletionToken
impl StructuralPartialEq for CompletionToken
Auto Trait Implementations§
impl Freeze for CompletionToken
impl RefUnwindSafe for CompletionToken
impl Send for CompletionToken
impl Sync for CompletionToken
impl Unpin for CompletionToken
impl UnwindSafe for CompletionToken
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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