Struct tarantool::fiber::Fyber

source ·
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,

source

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.

source

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.

source§

impl<'f, F, T> Fyber<F, T>where F: FnOnce() -> T + 'f, T: 'f,

source

pub fn spawn_lua( name: String, f: F, _attr: Option<&FiberAttr> ) -> Result<JoinHandle<'f, T>>

Creates a joinable LUA fiber and schedules it for execution at some point later. Does NOT yield.

Trait Implementations§

source§

impl<F, T> Debug for Fyber<F, T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.