Struct laminarmq::storage::commit_log::segmented_log::store::Store
source · pub struct Store<S, H> { /* private fields */ }
Expand description
Implementations§
source§impl<S, H> Store<S, H>
impl<S, H> Store<S, H>
sourcepub async fn read(
&self,
position: &S::Position,
record_header: &RecordHeader
) -> Result<S::Content, StoreError<S::Error>>
pub async fn read( &self, position: &S::Position, record_header: &RecordHeader ) -> Result<S::Content, StoreError<S::Error>>
Reads record bytes for a record persisted at the given position
with the designated
RecordHeader
.
sourcepub async fn append<XBuf, X, XE>(
&mut self,
stream: X,
append_threshold: Option<S::Size>
) -> Result<(S::Position, RecordHeader), StoreError<S::Error>>
pub async fn append<XBuf, X, XE>( &mut self, stream: X, append_threshold: Option<S::Size> ) -> Result<(S::Position, RecordHeader), StoreError<S::Error>>
Appends the bytes for a new record at the end of this store.
Returns the computed RecordHeader
for the provided record bytes along with the
position where the record was written.
Trait Implementations§
source§impl<S: Storage, H> AsyncConsume for Store<S, H>
impl<S: Storage, H> AsyncConsume for Store<S, H>
§type ConsumeError = StoreError<<S as Storage>::Error>
type ConsumeError = StoreError<<S as Storage>::Error>
Error that can occur during a consumption operation.
source§impl<S: Storage, H> AsyncTruncate for Store<S, H>
impl<S: Storage, H> AsyncTruncate for Store<S, H>
§type Mark = <S as AsyncTruncate>::Mark
type Mark = <S as AsyncTruncate>::Mark
Type to denote a truncation “mark”, after which the collection will be truncated.
§type TruncError = StoreError<<S as Storage>::Error>
type TruncError = StoreError<<S as Storage>::Error>
Error that can occur during a truncation operation.
source§fn truncate<'life0, 'life1, 'async_trait>(
&'life0 mut self,
pos: &'life1 Self::Mark
) -> Pin<Box<dyn Future<Output = Result<(), Self::TruncError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn truncate<'life0, 'life1, 'async_trait>(
&'life0 mut self,
pos: &'life1 Self::Mark
) -> Pin<Box<dyn Future<Output = Result<(), Self::TruncError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Truncates this collection after the given mark, such that this collection
contains records only upto this “mark”.
Auto Trait Implementations§
impl<S, H> Freeze for Store<S, H>where
S: Freeze,
impl<S, H> RefUnwindSafe for Store<S, H>where
H: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, H> Send for Store<S, H>
impl<S, H> Sync for Store<S, H>
impl<S, H> Unpin for Store<S, H>
impl<S, H> UnwindSafe for Store<S, H>where
H: UnwindSafe,
S: UnwindSafe,
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