pub struct FolderRegistry { /* private fields */ }Expand description
Registry of folders and subscriptions currently managed by the daemon.
Implementations§
Source§impl FolderRegistry
impl FolderRegistry
pub fn new() -> Self
Sourcepub fn add(&mut self, entry: FolderEntry) -> Result<()>
pub fn add(&mut self, entry: FolderEntry) -> Result<()>
Sourcepub fn add_or_update(&mut self, entry: FolderEntry) -> Result<()>
pub fn add_or_update(&mut self, entry: FolderEntry) -> Result<()>
Add a folder, or attach a path to a folder restored without one.
§Errors
Returns an error when the namespace is already managed with a path or when the requested update conflicts with an existing registration.
pub fn remove(&mut self, namespace: &NamespaceId) -> Option<FolderEntry>
pub fn is_removed(&self, namespace: &str) -> bool
Sourcepub fn add_subscription(&mut self, subscription: PublicSubscription)
pub fn add_subscription(&mut self, subscription: PublicSubscription)
Add a subscription to the registry.
Sourcepub fn remove_subscription(
&mut self,
namespace_id: &str,
) -> Option<PublicSubscription>
pub fn remove_subscription( &mut self, namespace_id: &str, ) -> Option<PublicSubscription>
Remove a subscription by its namespace ID (e.g. "blob:<hash>").
pub fn subscription_statuses(&self) -> Vec<FolderStatusReport>
pub fn statuses(&self) -> Vec<FolderStatusReport>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn path_for(&self, namespace: &str) -> Option<PathBuf>
pub fn path_for(&self, namespace: &str) -> Option<PathBuf>
Return the mount path registered for a folder namespace, if any.
pub fn record_import( &mut self, namespace: NamespaceId, entries: u64, timestamp: u64, )
pub fn record_error(&mut self, namespace: NamespaceId, error: impl Into<String>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FolderRegistry
impl RefUnwindSafe for FolderRegistry
impl Send for FolderRegistry
impl Sync for FolderRegistry
impl Unpin for FolderRegistry
impl UnsafeUnpin for FolderRegistry
impl UnwindSafe for FolderRegistry
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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