pub struct SqliteStore { /* private fields */ }Expand description
sqlite-backed durability store.
Implementations§
Source§impl SqliteStore
impl SqliteStore
Sourcepub fn open<P: AsRef<Path>>(path: P, default_contract: Contract) -> Result<Self>
pub fn open<P: AsRef<Path>>(path: P, default_contract: Contract) -> Result<Self>
Opens (creating if absent) a sqlite store at path with WAL mode.
§Errors
sqlite open/pragma/schema failure.
Sourcepub fn open_in_memory(default_contract: Contract) -> Result<Self>
pub fn open_in_memory(default_contract: Contract) -> Result<Self>
In-memory sqlite store (tests / pure-TRANSIENT-via-sqlite).
§Errors
sqlite open/pragma/schema failure.
Trait Implementations§
Source§impl DurabilityStore for SqliteStore
impl DurabilityStore for SqliteStore
Source§fn set_contract(&self, topic: &str, contract: Contract) -> Result<()>
fn set_contract(&self, topic: &str, contract: Contract) -> Result<()>
Registers (or replaces) the retention
Contract for topic. The
daemon calls this when it starts serving a topic. Topics without an
explicit contract use the store’s default (Contract::default). Read moreSource§fn store(&self, sample: DurabilitySample) -> Result<()>
fn store(&self, sample: DurabilitySample) -> Result<()>
Persists
sample durably, enforcing the topic contract. Returns
StoreError::OutOfResources when a KEEP_ALL cap
is hit. Read moreSource§fn query(&self, topic: &str, selector: &Selector) -> Result<Page>
fn query(&self, topic: &str, selector: &Selector) -> Result<Page>
Returns one ordered
Page of samples for topic matching selector.
Ordering is (instance_key, sequence). Drive pagination via
Page::next + Selector::after_cursor. Read moreSource§fn unregister(
&self,
topic: &str,
instance_key: &[u8; 16],
now: SystemTime,
) -> Result<()>
fn unregister( &self, topic: &str, instance_key: &[u8; 16], now: SystemTime, ) -> Result<()>
Source§fn cleanup(&self, now: SystemTime) -> Result<usize>
fn cleanup(&self, now: SystemTime) -> Result<usize>
Purges instances whose
unregister time + cleanup-delay is <= now.
Returns the number of purged instances. Read moreSource§fn replay_for_topic(
&self,
topic: &str,
) -> Result<Vec<DurabilitySample>, StoreError>
fn replay_for_topic( &self, topic: &str, ) -> Result<Vec<DurabilitySample>, StoreError>
Auto Trait Implementations§
impl !Freeze for SqliteStore
impl RefUnwindSafe for SqliteStore
impl Send for SqliteStore
impl Sync for SqliteStore
impl Unpin for SqliteStore
impl UnsafeUnpin for SqliteStore
impl UnwindSafe for SqliteStore
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