Module proc_state

Source
Expand description

State layer for lightproc implementation

Contains trait bounds and state wrapping code

§Example

use lightproc::proc_state::State;
use crate::lightproc::proc_state::AsAny;

#[derive(Clone)]
pub struct SharedState {
    name: String,
    surname: String,
    id: u64,
}


let mut s = SharedState {
    name: "Riemann".to_string(),
    surname: "Sum".to_string(),
    id: 123
};

s.as_any();

Structs§

EmptyState
Base construct for empty state struct.

Traits§

AsAny
Generic dynamic programming construct which allows us to downcast to the typeless level. And do costly conversion between types if possible.
State
State trait to implement a state for Bastion

Type Aliases§

EmptyProcState
Empty proc state which is an heap allocated empty struct.
ProcState
Generic protection type where state is stored as is. This allows us to share the state between the threads (both by ref and by value). All state implementors bound to use this.