pub struct RootRegistry { /* private fields */ }Expand description
In-memory root registry. The durable store persists these records; this holds the live state for the daemon scheduler.
Implementations§
Source§impl RootRegistry
impl RootRegistry
Sourcepub fn register(
&mut self,
canonical_path: Vec<u8>,
filesystem_identity: FilesystemIdentity,
mode: GuardRootMode,
) -> GuardRootRecord
pub fn register( &mut self, canonical_path: Vec<u8>, filesystem_identity: FilesystemIdentity, mode: GuardRootMode, ) -> GuardRootRecord
Register a new root. Returns the initial record in Stopped state.
Sourcepub fn insert_record(&mut self, record: GuardRootRecord)
pub fn insert_record(&mut self, record: GuardRootRecord)
Insert a fully-formed root record. Used when restoring from
the durable store, where the complete record state must be
preserved rather than initialized to Stopped.
Sourcepub fn get(&self, canonical_path: &[u8]) -> Option<&GuardRootRecord>
pub fn get(&self, canonical_path: &[u8]) -> Option<&GuardRootRecord>
Look up a root by canonical path bytes.
Sourcepub fn get_mut(&mut self, canonical_path: &[u8]) -> Option<&mut GuardRootRecord>
pub fn get_mut(&mut self, canonical_path: &[u8]) -> Option<&mut GuardRootRecord>
Look up a root by canonical path bytes for mutation.
Sourcepub fn remove(&mut self, canonical_path: &[u8]) -> Option<GuardRootRecord>
pub fn remove(&mut self, canonical_path: &[u8]) -> Option<GuardRootRecord>
Remove a root from the registry.
Sourcepub fn list(&self) -> Vec<&GuardRootRecord>
pub fn list(&self) -> Vec<&GuardRootRecord>
List all registered roots.
Sourcepub fn count_by_state(&self, state: GuardRootState) -> usize
pub fn count_by_state(&self, state: GuardRootState) -> usize
Count roots by state.
Trait Implementations§
Source§impl Debug for RootRegistry
impl Debug for RootRegistry
Source§impl Default for RootRegistry
impl Default for RootRegistry
Source§fn default() -> RootRegistry
fn default() -> RootRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RootRegistry
impl RefUnwindSafe for RootRegistry
impl Send for RootRegistry
impl Sync for RootRegistry
impl Unpin for RootRegistry
impl UnsafeUnpin for RootRegistry
impl UnwindSafe for RootRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more