[−][src]Struct lightproc::proc_stack::ProcStack
Stack abstraction for lightweight processes
Example
use lightproc::proc_stack::ProcStack; ProcStack::default() .with_before_start(|| { println!("Before start"); }) .with_after_complete(|| { println!("After complete"); }) .with_after_panic(|| { println!("After panic"); });
Fields
pid: AtomicUsize
Process ID for the Lightweight Process
Can be used to identify specific processes during any executor, reactor implementations.
Methods
impl ProcStack
[src]
pub fn with_pid(self, pid: usize) -> Self
[src]
Adds pid for the process which is going to take this stack
use lightproc::proc_stack::ProcStack; ProcStack::default() .with_pid(1);
pub fn with_before_start<T>(self, callback: T) -> Self where
T: Fn() + Send + Sync + 'static,
[src]
T: Fn() + Send + Sync + 'static,
Adds a callback that will be executed before polling inner future to the stack
use lightproc::proc_stack::ProcStack; ProcStack::default() .with_before_start(|| { println!("Before start") });
pub fn with_after_complete<T>(self, callback: T) -> Self where
T: Fn() + Send + Sync + 'static,
[src]
T: Fn() + Send + Sync + 'static,
Adds a callback that will be executed after inner future resolves to an output to the stack
use lightproc::proc_stack::ProcStack; ProcStack::default() .with_after_complete(|| { println!("After complete") });
pub fn with_after_panic<T>(self, callback: T) -> Self where
T: Fn() + Send + Sync + 'static,
[src]
T: Fn() + Send + Sync + 'static,
Adds a callback that will be executed after inner future panics to the stack
use lightproc::proc_stack::ProcStack; ProcStack::default() .with_after_panic(|| { println!("After panic") });
pub fn get_pid(&self) -> usize
[src]
Utility function to get_pid for the implementation of executors.
use lightproc::proc_stack::ProcStack; let proc = ProcStack::default().with_pid(123); assert_eq!(proc.get_pid(), 123);
Trait Implementations
impl Clone for ProcStack
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for ProcStack
[src]
impl Debug for ProcStack
[src]
Auto Trait Implementations
impl Send for ProcStack
impl Sync for ProcStack
impl Unpin for ProcStack
impl !UnwindSafe for ProcStack
impl !RefUnwindSafe for ProcStack
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,