pub trait CuLogCodec<P>: 'staticwhere
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§
type Config: DeserializeOwned + Default
Required Methods§
fn new(config: Self::Config) -> Result<Self, CuError>where
Self: Sized,
Sourcefn source_payload_handle_bytes(&self, payload: &P) -> usize
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.
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>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".