[][src]Struct generator::GeneratorImpl

#[repr(C)]
pub struct GeneratorImpl<'a, A, T> { /* fields omitted */ }

GeneratorImpl

Methods

impl<'a, A: Any, T: Any> GeneratorImpl<'a, A, T>[src]

pub fn init_context(&mut self)[src]

create a new generator with default stack size

impl<'a, A, T> GeneratorImpl<'a, A, T>[src]

pub fn new(size: usize) -> Box<Self>[src]

create a new generator with specified stack size

pub fn prefetch(&self)[src]

prefetch the generator into cache

pub fn scoped_init<F: FnOnce(Scope<'a, A, T>) -> T + 'a>(&mut self, f: F) where
    T: 'a,
    A: 'a, 
[src]

init a heap based generator with scoped closure

pub fn init<F: FnOnce() -> T + 'a>(&mut self, f: F) where
    T: 'a, 
[src]

init a heap based generator

pub fn set_para(&mut self, para: A)[src]

prepare the para that passed into generator before send

pub fn set_local_data(&mut self, data: *mut u8)[src]

set the generator local data

pub fn get_local_data(&self) -> *mut u8[src]

get the generator local data

pub fn get_panic_data(&mut self) -> Option<Box<dyn Any + Send>>[src]

get the generator panic data

pub fn resume(&mut self) -> Option<T>[src]

resume the generator without touch the para you should call set_para before this method

pub fn raw_send(&mut self, para: Option<A>) -> Option<T>[src]

raw_send

pub fn send(&mut self, para: A) -> T[src]

send interface

pub unsafe fn cancel(&mut self)[src]

cancel the generator this will trigger a Cancel panic, it's unsafe in that you must care about the resource

pub fn is_done(&self) -> bool[src]

is finished

pub fn stack_usage(&self) -> (usize, usize)[src]

get stack total size and used size in word

Trait Implementations

impl<A, T> Send for GeneratorImpl<'static, A, T>[src]

impl<'a, A, T> Drop for GeneratorImpl<'a, A, T>[src]

impl<'a, T> Iterator for GeneratorImpl<'a, (), T>[src]

type Item = T

The type of the elements being iterated over.

impl<'a, A, T> Debug for GeneratorImpl<'a, A, T>[src]

Auto Trait Implementations

impl<'a, A, T> !Sync for GeneratorImpl<'a, A, T>

impl<'a, A, T> Unpin for GeneratorImpl<'a, A, T> where
    A: Unpin,
    T: Unpin

impl<'a, A, T> !UnwindSafe for GeneratorImpl<'a, A, T>

impl<'a, A, T> !RefUnwindSafe for GeneratorImpl<'a, A, T>

Blanket Implementations

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

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

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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.

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

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

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