pub struct FileStore { /* private fields */ }Expand description
File-per-sample durability store rooted at a directory.
Implementations§
Trait Implementations§
Source§impl DurabilityStore for FileStore
impl DurabilityStore for FileStore
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 set_topic_meta(&self, topic: &str, meta: TopicMeta) -> Result<()>
fn set_topic_meta(&self, topic: &str, meta: TopicMeta) -> Result<()>
Persists what the durability service (or any other caller) needs to
resume serving
topic after a restart, with no writer or reader
re-discovered first: its type name, keyedness, and the retention
contract in force (see TopicMeta). Called once, when a topic is
first served. Also becomes the contract
store/cleanup enforce for topic
(superseding a plain set_contract for the same
topic — see its doc). Read moreSource§fn topic_meta(&self, topic: &str) -> Result<Option<TopicMeta>>
fn topic_meta(&self, topic: &str) -> Result<Option<TopicMeta>>
The persisted
TopicMeta for topic, if
set_topic_meta was ever called for it.
None for a topic that only ever saw
set_contract (contract-only, no served
type/keyedness known) or was never registered at all. 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 FileStore
impl RefUnwindSafe for FileStore
impl Send for FileStore
impl Sync for FileStore
impl Unpin for FileStore
impl UnsafeUnpin for FileStore
impl UnwindSafe for FileStore
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