pub trait EncodeCtx: Send {
// Required methods
fn encode_bytes(&mut self, bytes: &[u8]) -> Result<(), EncodeError>;
fn finish(self: Box<Self>) -> Result<Frame, EncodeError>;
}Expand description
Context for encoding values into frames.
Each transport provides its own implementation that knows how to best represent data for that transport.
Note: Type-aware encoding (via facet) is handled by the RPC layer, not directly by EncodeCtx. This trait handles raw byte encoding.
Required Methods§
Sourcefn encode_bytes(&mut self, bytes: &[u8]) -> Result<(), EncodeError>
fn encode_bytes(&mut self, bytes: &[u8]) -> Result<(), EncodeError>
Encode raw bytes into the frame.
For SHM: checks if bytes are already in SHM and references them zero-copy. For stream: copies into the output buffer.