pub struct NoopStore { /* private fields */ }Expand description
A no-op store: sequence numbers are tracked in memory for the session’s lifetime (matching
QFJ’s own NoopStore, NEW-118/audit 006 – previously always reported 1 regardless of
set_next_*_seq calls) but nothing else is persisted; save/get are no-ops.
Implementations§
Trait Implementations§
Source§impl MessageStore for NoopStore
impl MessageStore for NoopStore
Source§fn next_sender_seq<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next_sender_seq<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The next outbound (sender) sequence number.
Source§fn next_target_seq<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next_target_seq<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The next inbound (target) sequence number expected.
Source§fn set_next_sender_seq<'life0, 'async_trait>(
&'life0 self,
seq: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_next_sender_seq<'life0, 'async_trait>(
&'life0 self,
seq: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the next outbound sequence number.
Source§fn set_next_target_seq<'life0, 'async_trait>(
&'life0 self,
seq: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_next_target_seq<'life0, 'async_trait>(
&'life0 self,
seq: u64,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Set the next inbound sequence number.
Source§fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
_seq: u64,
_message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save<'life0, 'life1, 'async_trait>(
&'life0 self,
_seq: u64,
_message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Persist an outbound message’s bytes under its sequence number.
Source§fn get<'life0, 'async_trait>(
&'life0 self,
_begin: u64,
_end: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, Vec<u8>)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
_begin: u64,
_end: u64,
) -> Pin<Box<dyn Future<Output = Result<Vec<(u64, Vec<u8>)>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Retrieve stored messages whose sequence numbers fall in
[begin, end], in order.Source§fn reset<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reset<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reset: clear stored messages and set both sequence numbers back to 1.
Source§fn was_corrupted(&self) -> bool
fn was_corrupted(&self) -> bool
Whether this store detected and recovered from corruption when it was opened
(
ForceResendWhenCorruptedStore). Backends with no corruption-detection concept (e.g.
MemoryStore, NoopStore, SQL backends relying on the database’s own durability) default
to false.Source§fn creation_time<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<OffsetDateTime>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn creation_time<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<OffsetDateTime>, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The wall-clock time this store was created (or last reset), if the backend tracks one
(GAP-38/FR-017, feature 005).
None for backends with no such concept (e.g.
MemoryStore, NoopStore) or when not yet recorded.Source§fn save_and_advance_sender<'life0, 'life1, 'async_trait>(
&'life0 self,
seq: u64,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_and_advance_sender<'life0, 'life1, 'async_trait>(
&'life0 self,
seq: u64,
message: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Atomically persist an outbound message and advance the sender sequence past it
(GAP-39/FR-018, feature 005): closes the crash window where
save() succeeds but a
subsequent set_next_sender_seq() doesn’t (or vice versa), which could otherwise
double-send or skip a sequence number on restart. The default implementation preserves
today’s behavior (two independent calls) for any backend that doesn’t override it.Source§fn contains<'life0, 'async_trait>(
&'life0 self,
seq: u64,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn contains<'life0, 'async_trait>(
&'life0 self,
seq: u64,
) -> Pin<Box<dyn Future<Output = Result<bool, StoreError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Whether a message is already saved under
seq (NEW-137, audit 006): a way for callers to
observe duplicate sequence usage without changing save()’s existing overwrite-on-conflict
contract (deliberately kept separate rather than having save() itself return an
overwrote-something flag, to avoid a breaking signature change across every backend).
Default Ok(false) for any backend that doesn’t override it.Auto Trait Implementations§
impl !Freeze for NoopStore
impl RefUnwindSafe for NoopStore
impl Send for NoopStore
impl Sync for NoopStore
impl Unpin for NoopStore
impl UnsafeUnpin for NoopStore
impl UnwindSafe for NoopStore
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