[−][src]Struct tarantool_module::fiber::Fiber
Contains information about fiber
Implementations
impl<'a, T> Fiber<'a, T>
[src]
pub fn new<F>(name: &str, callback: &mut F) -> Self where
F: FnMut(Box<T>) -> i32,
[src]
F: FnMut(Box<T>) -> i32,
Create a new fiber.
Takes a fiber from fiber cache, if it's not empty. Can fail only if there is not enough memory for the fiber structure or fiber stack.
The created fiber automatically returns itself to the fiber cache when its main
function
completes.
name
- string with fiber namecallback
- function for run inside fiber
See also: start
pub fn start(&mut self, arg: T)
[src]
pub fn wakeup(&self)
[src]
Interrupt a synchronous wait of a fiber
pub fn join(&self) -> i32
[src]
Wait until the fiber is dead and then move its execution status to the caller. The fiber must not be detached (See also: set_joinable).
Returns fiber function ret code
pub fn set_joinable(&mut self, is_joinable: bool)
[src]
Set fiber to be joinable (false by default).
is_joinable
- status to set
pub fn cancel(&mut self)
[src]
Cancel the subject fiber. (set FIBER_IS_CANCELLED
flag)
If target fiber's flag FIBER_IS_CANCELLABLE
set, then it would be woken up (maybe prematurely).
Then current fiber yields until the target fiber is dead (or is woken up by
wakeup).
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for Fiber<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<'a, T> !Send for Fiber<'a, T>
impl<'a, T> !Sync for Fiber<'a, T>
impl<'a, T> Unpin for Fiber<'a, T>
impl<'a, T> UnwindSafe for Fiber<'a, T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,