pub struct Catalog { /* private fields */ }Expand description
The authoritative orbok catalog.
Implementations§
Source§impl Catalog
impl Catalog
Sourcepub fn open(path: impl AsRef<Path>) -> OrbokResult<Self>
pub fn open(path: impl AsRef<Path>) -> OrbokResult<Self>
Open (or create) the catalog at path, apply pragmas, and run
pending migrations. Migration failure aborts startup (RFC-002
§6.2).
Sourcepub fn open_in_memory() -> OrbokResult<Self>
pub fn open_in_memory() -> OrbokResult<Self>
Open an in-memory catalog (tests).
Sourcepub fn lock(&self) -> MutexGuard<'_, Connection>
pub fn lock(&self) -> MutexGuard<'_, Connection>
Acquire the serialized connection. Repositories use this; the guard scope is kept short.
Sourcepub fn schema_version(&self) -> OrbokResult<i64>
pub fn schema_version(&self) -> OrbokResult<i64>
Current schema version (0 when no migration has been applied).
Auto Trait Implementations§
impl !Freeze for Catalog
impl RefUnwindSafe for Catalog
impl Send for Catalog
impl Sync for Catalog
impl Unpin for Catalog
impl UnsafeUnpin for Catalog
impl UnwindSafe for Catalog
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