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§
- Empty
State - 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§
- Empty
Proc State - Empty proc state which is an heap allocated empty struct.
- Proc
State - 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.