kjuulh
4a0fcd1bbb
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
25 lines
397 B
Rust
25 lines
397 B
Rust
use std::{ops::Deref, sync::Arc};
|
|
|
|
use crate::core_state::State;
|
|
|
|
#[derive(Clone)]
|
|
pub struct SharedState {
|
|
state: Arc<State>,
|
|
}
|
|
|
|
impl Deref for SharedState {
|
|
type Target = State;
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
&self.state
|
|
}
|
|
}
|
|
|
|
impl From<State> for SharedState {
|
|
fn from(value: State) -> Self {
|
|
Self {
|
|
state: Arc::new(value),
|
|
}
|
|
}
|
|
}
|