pub struct StreamingLogMsg {
pub kind: MessageKind,
pub version: CrateVersion,
pub encoded: Option<Bytes>,
pub byte_span: Span<u64>,
/* private fields */
}Expand description
A transport-level LogMsg with extra contextual information.
Yielded by the StreamingDecoder.
Fields§
§kind: MessageKind§version: CrateVersionThe CrateVersion of the RRD stream from which this LogMsg was taken from.
encoded: Option<Bytes>The original Protobuf-encoded bytes of this LogMsg, including headers.
Only set if StreamingDecoderOptions::keep_encoded_protobuf is true.
byte_span: Span<u64>Where in the underlying storage resource is this message (in bytes)?
Specifically, the start of this range points to the beginning of the MessageHeader.
The full range covers both the message’s header and its body.
Implementations§
Source§impl StreamingLogMsg
impl StreamingLogMsg
Sourcepub fn from_chunk(store_id: StoreId, chunk: &Chunk) -> Result<Self, EncodeError>
pub fn from_chunk(store_id: StoreId, chunk: &Chunk) -> Result<Self, EncodeError>
Create a new StreamingLogMsg from a Chunk.
This is only really useful for testing purposes, and makes no effort at all to be efficient.
Sourcepub fn decoded_transport(&self) -> Result<Option<Msg>, DecodeError>
pub fn decoded_transport(&self) -> Result<Option<Msg>, DecodeError>
Returns the decoded transport-level LogMsg.
This will only decode at the transport-layer (Protobuf), Arrow data is left untouched.
Compute cost:
- If
StreamingDecoderOptions::keep_decoded_protobufwas set on theStreamingDecoderwhen producing theStreamingLogMsg, this is free. - Otherwise, if
StreamingDecoderOptions::keep_encoded_protobufwas set, this has to perform Protobuf decoding. - Otherwise, if neither are set, this just returns
None.
Trait Implementations§
Source§impl Clone for StreamingLogMsg
impl Clone for StreamingLogMsg
Source§fn clone(&self) -> StreamingLogMsg
fn clone(&self) -> StreamingLogMsg
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for StreamingLogMsg
impl RefUnwindSafe for StreamingLogMsg
impl Send for StreamingLogMsg
impl Sync for StreamingLogMsg
impl Unpin for StreamingLogMsg
impl UnwindSafe for StreamingLogMsg
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request