[][src]Struct greenie::generator::Generator

pub struct Generator {
    pub state: Ptr<GeneratorState>,
    pub thread: Ptr<Context>,
    pub to: Ptr<Context>,
    pub is_join: bool,
    // some fields omitted
}

Fields

state: Ptr<GeneratorState>thread: Ptr<Context>to: Ptr<Context>is_join: bool

Methods

impl Generator[src]

pub fn spawn<F: 'static, A: 'static + ApplyTo<F> + Clone>(
    closure: F,
    args: A
) -> Rc<Self>
[src]

Spawn generator

pub fn resume(&self) -> Result<GeneratorState, &'static str>[src]

Resumes the execution of this generator. This function will resume execution of the generator or start execution if it hasn't already. This call will return back into the generator's last suspension point, resuming execution from the latest yield. The generator will continue executing until it either yields or returns, at which point this function will return.

Auto Trait Implementations

impl !RefUnwindSafe for Generator

impl !Send for Generator

impl !Sync for Generator

impl Unpin for Generator

impl !UnwindSafe for Generator

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.