Trait codecs::decoding::format::Deserializer
source · pub trait Deserializer: DynClone + Send + Sync {
// Required method
fn parse(
&self,
bytes: Bytes,
log_namespace: LogNamespace,
) -> Result<SmallVec<[Event; 1]>>;
}
Expand description
Parse structured events from bytes.
Required Methods§
sourcefn parse(
&self,
bytes: Bytes,
log_namespace: LogNamespace,
) -> Result<SmallVec<[Event; 1]>>
fn parse( &self, bytes: Bytes, log_namespace: LogNamespace, ) -> Result<SmallVec<[Event; 1]>>
Parses structured events from bytes.
It returns a SmallVec
rather than an Event
directly, since one byte
frame can potentially hold multiple events, e.g. when parsing a JSON
array. However, we optimize the most common case of emitting one event
by not requiring heap allocations for it.