2023-04-17 03:57:12 +01:00
|
|
|
use std::sync::{Arc, Mutex};
|
|
|
|
|
|
|
|
use prost_types::FileDescriptorSet;
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
pub struct SharedState(Arc<Mutex<SharedProtoData>>);
|
|
|
|
|
|
|
|
impl SharedState {
|
|
|
|
pub fn new() -> Self {
|
2023-06-04 19:05:33 +01:00
|
|
|
Self(Arc::new(Mutex::new(SharedProtoData { fds: None })))
|
2023-04-17 03:57:12 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl std::ops::Deref for SharedState {
|
|
|
|
type Target = Arc<Mutex<SharedProtoData>>;
|
|
|
|
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
|
|
&self.0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct SharedProtoData {
|
|
|
|
pub fds: Option<FileDescriptorSet>,
|
|
|
|
}
|