[][src]Struct lightproc::lightproc::LightProc

pub struct LightProc { /* fields omitted */ }

Struct to create and operate lightweight processes

Methods

impl LightProc[src]

pub fn recoverable<F, R, S>(
    future: F,
    schedule: S,
    stack: ProcStack
) -> (LightProc, RecoverableHandle<R>) where
    F: Future<Output = R> + Send + 'static,
    R: Send + 'static,
    S: Fn(LightProc) + Send + Sync + 'static, 
[src]

Creates a recoverable process which will signal occurred panic back to the poller.

Example

// ... creating a recoverable process
let panic_recoverable = LightProc::recoverable(
    future,
    schedule_function,
    proc_stack
);

pub fn build<F, R, S>(
    future: F,
    schedule: S,
    stack: ProcStack
) -> (LightProc, ProcHandle<R>) where
    F: Future<Output = R> + Send + 'static,
    R: Send + 'static,
    S: Fn(LightProc) + Send + Sync + 'static, 
[src]

Creates a standard process which will stop it's execution on occurrence of panic.

Example

// ... creating a standard process
let standard = LightProc::build(
    future,
    schedule_function,
    proc_stack
);

pub fn schedule(self)[src]

Schedule the lightweight process with passed schedule function at the build time.

pub fn run(self)[src]

Schedule the lightproc for runnning on the thread.

pub fn cancel(&self)[src]

Cancel polling the lightproc's inner future, thus cancelling th proc itself.

pub fn stack(&self) -> &ProcStack[src]

Gives a reference to given ProcStack when building the light proc.

Trait Implementations

impl Debug for LightProc[src]

impl Drop for LightProc[src]

impl Send for LightProc[src]

impl Sync for LightProc[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> AsAny for T where
    T: Any
[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> State for T where
    T: Send + Sync + 'static, 
[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.