pub struct LogBatch { /* private fields */ }Expand description
Pre-encoded log.stream.v1.GetResponse stored for a retained sequence batch.
Implementations§
Source§impl LogBatch
impl LogBatch
Sourcepub fn from_response_bytes(
sequence_number: u64,
response_bytes: impl Into<Bytes>,
) -> Self
pub fn from_response_bytes( sequence_number: u64, response_bytes: impl Into<Bytes>, ) -> Self
Wrap protobuf bytes already encoded as log.stream.v1.GetResponse.
Sourcepub fn from_entries(sequence_number: u64, kvs: Vec<(Bytes, Bytes)>) -> Self
pub fn from_entries(sequence_number: u64, kvs: Vec<(Bytes, Bytes)>) -> Self
Build a log batch from key-value pairs.
Sourcepub fn from_response(response: StreamGetResponse) -> Self
pub fn from_response(response: StreamGetResponse) -> Self
Build a log batch from an owned response.
Sourcepub fn sequence_number(&self) -> u64
pub fn sequence_number(&self) -> u64
Sequence number under which this batch was loaded.
Sourcepub fn into_response_bytes(self) -> Bytes
pub fn into_response_bytes(self) -> Bytes
Consume the batch into its pre-encoded response bytes.
Sourcepub fn decode_response(&self) -> Result<StreamGetResponse, String>
pub fn decode_response(&self) -> Result<StreamGetResponse, String>
Decode the stored response for paths that need to inspect entries.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LogBatch
impl RefUnwindSafe for LogBatch
impl Send for LogBatch
impl Sync for LogBatch
impl Unpin for LogBatch
impl UnsafeUnpin for LogBatch
impl UnwindSafe for LogBatch
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