pub struct Fiber { /* private fields */ }Expand description
One suspendable C call.
Implementations§
Source§impl Fiber
impl Fiber
Sourcepub fn new(entry: impl FnOnce() + 'static) -> Option<Fiber>
pub fn new(entry: impl FnOnce() + 'static) -> Option<Fiber>
A fiber that will run entry on its own stack on the first
Self::resume. None when the stack cannot be mapped.
Sourcepub fn resume(&mut self) -> FiberState
pub fn resume(&mut self) -> FiberState
Runs the fiber until it yields or finishes. Resumes a panic raised inside it. Must not be called from inside the same fiber.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Whether the entry closure has returned.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Fiber
impl !Send for Fiber
impl !Sync for Fiber
impl !UnwindSafe for Fiber
impl Freeze for Fiber
impl Unpin for Fiber
impl UnsafeUnpin for Fiber
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