hyperlog/crates/hyperlog-tui/src/state.rs
kjuulh 4a0fcd1bbb
All checks were successful
continuous-integration/drone/push Build is passing
feat: move core to tui and begin grpc work
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-05-11 23:23:00 +02:00

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),
}
}
}