pub struct Registry { /* private fields */ }Expand description
SQLite registry handle. Holds an advisory exclusive file lock for its lifetime (except for in-memory registries).
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn open_in_memory() -> Result<Self>
pub fn open_in_memory() -> Result<Self>
Open an in-memory registry (tests only). No file lock taken.
Sourcepub fn insert(&self, row: &BrowserRow) -> Result<()>
pub fn insert(&self, row: &BrowserRow) -> Result<()>
Insert (or replace) a row.
Sourcepub fn delete(&self, name: &str) -> Result<()>
pub fn delete(&self, name: &str) -> Result<()>
Delete a row by name. No error if it does not exist.
Sourcepub fn get_by_name(&self, name: &str) -> Result<Option<BrowserRow>>
pub fn get_by_name(&self, name: &str) -> Result<Option<BrowserRow>>
Look up a row by name.
Sourcepub fn list_all(&self) -> Result<Vec<BrowserRow>>
pub fn list_all(&self) -> Result<Vec<BrowserRow>>
All rows, no liveness check, ordered by started_at DESC.
Sourcepub fn list_alive(&self) -> Result<Vec<BrowserRow>>
pub fn list_alive(&self) -> Result<Vec<BrowserRow>>
All alive rows. Stale rows are deleted as a side-effect.
Sourcepub fn first_alive_by_kind(&self, kind: Kind) -> Result<Option<BrowserRow>>
pub fn first_alive_by_kind(&self, kind: Kind) -> Result<Option<BrowserRow>>
First alive row of the given kind (most recent first). Stale matches are pruned.
Sourcepub fn most_recent_alive(&self) -> Result<Option<BrowserRow>>
pub fn most_recent_alive(&self) -> Result<Option<BrowserRow>>
Most recently started alive row across all kinds.
Auto Trait Implementations§
impl !Freeze for Registry
impl !RefUnwindSafe for Registry
impl Send for Registry
impl !Sync for Registry
impl Unpin for Registry
impl UnsafeUnpin for Registry
impl !UnwindSafe for Registry
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
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