pub struct CatalogManager<T> { /* private fields */ }Expand description
Dynamic network/cache/bootstrap catalog manager.
Implementations§
Source§impl<T: CatalogTransport> CatalogManager<T>
impl<T: CatalogTransport> CatalogManager<T>
Sourcepub fn new(transport: T, cache: SecureDirectory) -> Self
pub fn new(transport: T, cache: SecureDirectory) -> Self
Uses an explicit secure directory, primarily for deterministic tests.
Sourcepub fn in_directory(
transport: T,
anchor: impl AsRef<Path>,
relative: impl AsRef<Path>,
) -> Self
pub fn in_directory( transport: T, anchor: impl AsRef<Path>, relative: impl AsRef<Path>, ) -> Self
Opens an explicit private cache below a trusted anchor.
Sourcepub fn load_cached(&self) -> Result<CatalogSnapshot, CatalogError>
pub fn load_cached(&self) -> Result<CatalogSnapshot, CatalogError>
The catalog to start from without touching the network: the validated cache, else the bundled bootstrap copy. A background refresh then checks models.dev.
Sourcepub fn load_cached_at(
&self,
now: Timestamp,
) -> Result<CatalogSnapshot, CatalogError>
pub fn load_cached_at( &self, now: Timestamp, ) -> Result<CatalogSnapshot, CatalogError>
Self::load_cached at a supplied time for deterministic tests.
Sourcepub async fn refresh(&self) -> Result<CatalogSnapshot, CatalogError>
pub async fn refresh(&self) -> Result<CatalogSnapshot, CatalogError>
Refreshes using the system clock.
Sourcepub async fn refresh_at(
&self,
now: Timestamp,
) -> Result<CatalogSnapshot, CatalogError>
pub async fn refresh_at( &self, now: Timestamp, ) -> Result<CatalogSnapshot, CatalogError>
Refreshes at a supplied time for deterministic tests.
Auto Trait Implementations§
impl<T> Freeze for CatalogManager<T>
impl<T> RefUnwindSafe for CatalogManager<T>where
T: RefUnwindSafe,
impl<T> Send for CatalogManager<T>
impl<T> Sync for CatalogManager<T>
impl<T> Unpin for CatalogManager<T>
impl<T> UnsafeUnpin for CatalogManager<T>
impl<T> UnwindSafe for CatalogManager<T>where
T: RefUnwindSafe,
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