pub struct Fyber<F, T> { /* private fields */ }
Expand description
A helper struct which is used to store information about a fiber being created. It’s only utility is the generic parameter which are associated with it.
TODO: add support for cancellable fibers. TODO: add support for non-joinable fibers.
Implementations§
source§impl<'f, F, T> Fyber<F, T>where
F: FnOnce() -> T + 'f,
T: 'f,
impl<'f, F, T> Fyber<F, T>where F: FnOnce() -> T + 'f, T: 'f,
sourcepub fn spawn_and_yield(
name: String,
f: F,
attr: Option<&FiberAttr>
) -> Result<JoinHandle<'f, T>>
pub fn spawn_and_yield( name: String, f: F, attr: Option<&FiberAttr> ) -> Result<JoinHandle<'f, T>>
Creates a joinable fiber and immediately yields execution to it.
sourcepub fn spawn_deferred(
name: String,
f: F,
attr: Option<&FiberAttr>
) -> Result<JoinHandle<'f, T>>
pub fn spawn_deferred( name: String, f: F, attr: Option<&FiberAttr> ) -> Result<JoinHandle<'f, T>>
Creates a joinable fiber and schedules it for execution at some point later. Does NOT yield.
Panicking
May panic if the current tarantool executable doesn’t support the
fiber_set_ctx
api.
Trait Implementations§
Auto Trait Implementations§
impl<F, T> RefUnwindSafe for Fyber<F, T>where F: RefUnwindSafe, T: RefUnwindSafe,
impl<F, T> Send for Fyber<F, T>where F: Send, T: Send,
impl<F, T> Sync for Fyber<F, T>where F: Sync, T: Sync,
impl<F, T> Unpin for Fyber<F, T>where F: Unpin, T: Unpin,
impl<F, T> UnwindSafe for Fyber<F, T>where F: UnwindSafe, T: UnwindSafe,
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