pub trait MapWriteFn {
// Required method
fn map_write(&mut self, buf: &mut Vec<u8>);
}
Expand description
A trait for mapping data written to an underlying writer.
Required Methods§
Sourcefn map_write(&mut self, buf: &mut Vec<u8>)
fn map_write(&mut self, buf: &mut Vec<u8>)
Applies a mapping function to the data before writing it to the underlying writer. This function takes a mutable reference to a buffer and modifies it in place.
Be aware that changing the capacity of the buffer will affect any subsequent writes, if this is not intended, ensure to reset the capacity of the buffer after processing.
This behavior is intended to allow for a variety of use cases, such as base64 encoding, which may require expanding the buffer size to accommodate the transformed data.