/// Adds state for the process which is going to be embedded into this stack.
///
/// # Example
///
/// ```rust
/// use lightproc::proc_stack::ProcStack;
///
/// pub struct GlobalState {
///    pub amount: usize
/// }
///
/// ProcStack::default()
///     .with_pid(1)
///     .with_state(GlobalState { amount: 1 });
/// ```
Adds state for the process which is going to be embedded into this stack.
Adds state for the process which is going to be embedded into this stack .
pub fn with_state<S>(mut self, state: S) -> Self
    where
        S: State + 'static,
    {
        self.state = Arc::new(Mutex::new(state));
        self
    }
pub fn with_state < S > ( mut self , state : S ) -> Self where S : State + ' static , { self . state = Arc :: new ( Mutex :: new ( state ) ) ; self }
Adds state for the process which is going to be embedded into this stack.
Adds state for the process which is going to be embedded into this stack .
mut self
state
S
example
```rust
use lightproc::proc_stack::ProcStack.

pub struct GlobalState {
pub amount: usize
}

:default()
.with_pid(1)
.with_state(GlobalState { amount: 1 });
```
` ` ` rust use lightproc :: proc_stack :: ProcStack . pub struct GlobalState { pub amount : usize } : default () . with_pid ( 1 ) . with_state ( GlobalState { amount : 1 } ) ; ` ` `