pub struct WorkTokenBuilder<W, S, C>where
W: FnOnce(),{ /* private fields */ }
Expand description
Builds WorkToken
s for the work queue. Both on_start and on_complete are optional.
§Example
let token: WorkToken = WorkTokenBuilder::new(|| { }).build(); // valid
let token: WorkToken = WorkTokenBuilder::new(|| { })
.on_complete(|| { })
.on_start(|| { })
.build()
;
Implementations§
Source§impl<W, S, C> WorkTokenBuilder<W, S, C>
impl<W, S, C> WorkTokenBuilder<W, S, C>
Source§impl<W> WorkTokenBuilder<W, fn(), fn()>
impl<W> WorkTokenBuilder<W, fn(), fn()>
Sourcepub fn new(work: W) -> WorkTokenBuilder<W, fn(), fn()>
pub fn new(work: W) -> WorkTokenBuilder<W, fn(), fn()>
Create a new WorkTokenBuilder
to construct new WorkToken
s
Source§impl<W, S1, C> WorkTokenBuilder<W, S1, C>where
W: FnOnce(),
impl<W, S1, C> WorkTokenBuilder<W, S1, C>where
W: FnOnce(),
pub fn on_start<S2>(self, on_start: S2) -> WorkTokenBuilder<W, S2, C>
Source§impl<W, S, C1> WorkTokenBuilder<W, S, C1>where
W: FnOnce(),
impl<W, S, C1> WorkTokenBuilder<W, S, C1>where
W: FnOnce(),
pub fn on_complete<C2>(self, on_complete: C2) -> WorkTokenBuilder<W, S, C2>
Auto Trait Implementations§
impl<W, S, C> Freeze for WorkTokenBuilder<W, S, C>
impl<W, S, C> RefUnwindSafe for WorkTokenBuilder<W, S, C>
impl<W, S, C> Send for WorkTokenBuilder<W, S, C>
impl<W, S, C> Sync for WorkTokenBuilder<W, S, C>
impl<W, S, C> Unpin for WorkTokenBuilder<W, S, C>
impl<W, S, C> UnwindSafe for WorkTokenBuilder<W, S, C>
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> InstanceOf for T
impl<T> InstanceOf for T
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