pub trait PayloadEncodeReferred {
// Required method
fn encode(&self) -> Result<Option<&[u8]>>;
}
Expand description
Provides an optional reference to an already-encoded payload.
This is a performance optimization: if the payload was already serialized, this trait can return a reference to the existing bytes and skip re-encoding.
Useful in zero-copy or deferred encoding scenarios.