pub struct Builder { /* private fields */ }
Expand description
Builder for creating root YieldProgress
instances.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn new() -> Builder
pub fn new() -> Builder
Constructs a Builder
.
The default values are:
- The yield function is
basic_yield_now
. - The progress function does nothing.
The call site of this function is considered to be the yield point preceding the first actual yield point.
Sourcepub fn build(self) -> YieldProgress
pub fn build(self) -> YieldProgress
Construct a new YieldProgress
using the behaviors specified by this builder.
Sourcepub fn yield_using<Y, YFut>(self, function: Y) -> Self
pub fn yield_using<Y, YFut>(self, function: Y) -> Self
Set the function which will be called in order to yield.
See basic_yield_now()
for the default implementation used if this is not not set, and
some information about what you might want to pass here instead.
Sourcepub fn progress_using<P>(self, function: P) -> Self
pub fn progress_using<P>(self, function: P) -> Self
Set the function which will be called in order to report progress.
If this is called more than once, the previous function will be discarded (there is no list of callbacks). If this is not called, the default function used does nothing.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
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