pub struct LocalRegistry { /* private fields */ }Expand description
Local registry that stores map snapshots and deltas.
Implementations§
Source§impl LocalRegistry
impl LocalRegistry
Sourcepub fn new(storage_dir: PathBuf) -> Result<Self>
pub fn new(storage_dir: PathBuf) -> Result<Self>
Create or open a local registry at the given directory.
Sourcepub fn push(
&mut self,
domain: &str,
map: &SiteMap,
delta: Option<MapDelta>,
) -> Result<()>
pub fn push( &mut self, domain: &str, map: &SiteMap, delta: Option<MapDelta>, ) -> Result<()>
Push a map (and optional delta) to the registry.
Sourcepub fn pull(&self, domain: &str) -> Result<Option<(SiteMap, DateTime<Utc>)>>
pub fn pull(&self, domain: &str) -> Result<Option<(SiteMap, DateTime<Utc>)>>
Pull the latest map for a domain.
Sourcepub fn pull_since(
&self,
domain: &str,
since: DateTime<Utc>,
) -> Result<Option<Vec<MapDelta>>>
pub fn pull_since( &self, domain: &str, since: DateTime<Utc>, ) -> Result<Option<Vec<MapDelta>>>
Pull only deltas since a given timestamp.
Sourcepub fn list(&self) -> Vec<&RegistryEntry>
pub fn list(&self) -> Vec<&RegistryEntry>
List all entries in the registry.
Sourcepub fn stats(&self) -> RegistryStats
pub fn stats(&self) -> RegistryStats
Get registry statistics.
Auto Trait Implementations§
impl Freeze for LocalRegistry
impl RefUnwindSafe for LocalRegistry
impl Send for LocalRegistry
impl Sync for LocalRegistry
impl Unpin for LocalRegistry
impl UnsafeUnpin for LocalRegistry
impl UnwindSafe for LocalRegistry
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