pub struct DaemonState {
pub schema_version: u32,
pub pid: u32,
pub started_at: String,
pub stopped_at: Option<String>,
pub data_root: PathBuf,
pub agg_port: Option<u16>,
pub proxies: Vec<ProxyEntry>,
}Fields§
§schema_version: u32§pid: u32§started_at: String§stopped_at: Option<String>§data_root: PathBuf§agg_port: Option<u16>§proxies: Vec<ProxyEntry>Implementations§
Source§impl DaemonState
impl DaemonState
Sourcepub fn load(path: &Path) -> Result<Option<DaemonState>>
pub fn load(path: &Path) -> Result<Option<DaemonState>>
Load state from disk. Returns Ok(None) when the file does not exist;
returns Err with the path on corrupt JSON or other IO errors.
Sourcepub fn save(&self, path: &Path) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
Save state atomically: write to <path>.tmp (mode 0600 on Unix),
fsync, then rename over path.
Sourcepub fn find_proxy(&self, provider: &str, upstream: &str) -> Option<&ProxyEntry>
pub fn find_proxy(&self, provider: &str, upstream: &str) -> Option<&ProxyEntry>
Exact-match lookup. No URL normalization.
Trait Implementations§
Source§impl Clone for DaemonState
impl Clone for DaemonState
Source§fn clone(&self) -> DaemonState
fn clone(&self) -> DaemonState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DaemonState
impl Debug for DaemonState
Source§impl<'de> Deserialize<'de> for DaemonState
impl<'de> Deserialize<'de> for DaemonState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DaemonState
impl PartialEq for DaemonState
Source§fn eq(&self, other: &DaemonState) -> bool
fn eq(&self, other: &DaemonState) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DaemonState
impl Serialize for DaemonState
impl Eq for DaemonState
impl StructuralPartialEq for DaemonState
Auto Trait Implementations§
impl Freeze for DaemonState
impl RefUnwindSafe for DaemonState
impl Send for DaemonState
impl Sync for DaemonState
impl Unpin for DaemonState
impl UnsafeUnpin for DaemonState
impl UnwindSafe for DaemonState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.