Skip to main content

write_value

Function write_value 

Source
pub fn write_value<W, T>(
    writer: &mut W,
    codec: &dyn Codec,
    value: &T,
    max_bytes: usize,
) -> AppResult<()>
where W: Write, T: Serialize + ?Sized,
Expand description

Encode value with codec and write it as one length-delimited frame.

ยงErrors

Returns a typed AppError (cause preserved) if encoding or the frame write fails, or the payload exceeds max_bytes.