usdpl_build/front/
shared_state.rs

1use std::sync::{Arc, Mutex};
2
3use prost_types::FileDescriptorSet;
4
5#[derive(Clone)]
6pub struct SharedState(Arc<Mutex<SharedProtoData>>);
7
8impl SharedState {
9    pub fn new() -> Self {
10        Self(Arc::new(Mutex::new(SharedProtoData { fds: None })))
11    }
12}
13
14impl std::ops::Deref for SharedState {
15    type Target = Arc<Mutex<SharedProtoData>>;
16
17    fn deref(&self) -> &Self::Target {
18        &self.0
19    }
20}
21
22pub struct SharedProtoData {
23    pub fds: Option<FileDescriptorSet>,
24}