Trait drone_core::fib::Fiber [−][src]
The main task unit of Drone.
Associated Types
type Input
[src]
The type of value this fiber consumes on each resume
.
type Yield
[src]
The type of value this fiber yields.
type Return
[src]
The type of value this fiber returns on completion.
Required methods
fn resume(
self: Pin<&mut Self>,
input: Self::Input
) -> FiberState<Self::Yield, Self::Return>
[src]
self: Pin<&mut Self>,
input: Self::Input
) -> FiberState<Self::Yield, Self::Return>
Resumes the execution of this fiber.
This method will resume execution of the fiber or start execution if it hasn’t already.
Return value
The FiberState
enum returned from this method indicates what state
the fiber is in upon returning. If FiberState::Yielded
is returned
then the fiber has reached a suspension point and a value has been
yielded out. Fibers in this state are available for resumption on a
later point.
If FiberState::Complete
is returned then the fiber has completely
finished with the value provided. It is invalid for the fiber to be
resumed again.
Panics
This method may panic if it is called after FiberState::Complete
has
been returned previously.
Implementors
impl<F, R> Fiber for FiberOnce<F, R> where
F: FnOnce() -> R,
F: Unpin,
[src]
F: FnOnce() -> R,
F: Unpin,
type Input = ()
type Return = R
type Yield = !
fn resume(self: Pin<&mut Self>, (): ()) -> FiberState<!, R>
[src]
impl<F, Y, R> Fiber for FiberFn<F, Y, R> where
F: FnMut() -> FiberState<Y, R>,
[src]
F: FnMut() -> FiberState<Y, R>,
type Input = ()
type Return = R
type Yield = Y
fn resume(self: Pin<&mut Self>, (): ()) -> FiberState<Y, R>
[src]
impl<G> Fiber for FiberGen<G> where
G: Generator,
[src]
G: Generator,