Skip to main content

CuLogCodec

Trait CuLogCodec 

Source
pub trait CuLogCodec<P>: 'static
where P: CuMsgPayload,
{ type Config: DeserializeOwned + Default; // Required methods fn new(config: Self::Config) -> Result<Self, CuError> where Self: Sized; fn source_payload_handle_bytes(&self, payload: &P) -> usize; fn encode_payload<E>( &mut self, payload: &P, encoder: &mut E, ) -> Result<(), EncodeError> where E: Encoder; fn decode_payload<D>(&mut self, decoder: &mut D) -> Result<P, DecodeError> where D: Decoder<Context = ()>; }

Required Associated Types§

Required Methods§

Source

fn new(config: Self::Config) -> Result<Self, CuError>
where Self: Sized,

Source

fn source_payload_handle_bytes(&self, payload: &P) -> usize

Returns handle-backed source bytes read directly by the codec.

This reports only extra handle-backed residency beyond the payload’s fixed size_of::<P>() footprint already accounted by runtime monitoring. Codecs must implement this explicitly so they opt into the correct accounting model for their payload type.

Source

fn encode_payload<E>( &mut self, payload: &P, encoder: &mut E, ) -> Result<(), EncodeError>
where E: Encoder,

Source

fn decode_payload<D>(&mut self, decoder: &mut D) -> Result<P, DecodeError>
where D: Decoder<Context = ()>,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§