pub struct Fiber<'e> { /* private fields */ }
Expand description
A fiber represents an independent, pausable thread of code execution.
Implementations
sourceimpl<'e> Fiber<'e>
impl<'e> Fiber<'e>
sourcepub fn resume<T>(&mut self) -> Result<Option<T>, Error>where
T: TryFromValue,
pub fn resume<T>(&mut self) -> Result<Option<T>, Error>where
T: TryFromValue,
Resumes execution of a fiber. If execution is done already, returns None
.
sourcepub fn trampoline<T>(self) -> Result<T, Error>where
T: TryFromValue,
pub fn trampoline<T>(self) -> Result<T, Error>where
T: TryFromValue,
Resumes execution of a fiber until it’s done evaluating all code. The last result is returned and results from intermediate yields are discarded.
This consumes the fiber, as calling one that’s finished is not useful.
Auto Trait Implementations
impl<'e> !RefUnwindSafe for Fiber<'e>
impl<'e> !Send for Fiber<'e>
impl<'e> !Sync for Fiber<'e>
impl<'e> Unpin for Fiber<'e>
impl<'e> !UnwindSafe for Fiber<'e>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more