pub trait OctetsWriter {
type Error;
// Required method
fn put_bytes(&mut self, v: &[u8]) -> Result<(), Self::Error>;
// Provided method
fn put_huffman_encoded<const LOWER_CASE: bool>(
&mut self,
v: &[u8],
) -> Result<(), Self::Error>
where Self: Sized { ... }
}Expand description
A byte sink for encoders in this crate.
This lets callers use octets encoders with output targets other than a
single contiguous OctetsMut buffer.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn put_huffman_encoded<const LOWER_CASE: bool>(
&mut self,
v: &[u8],
) -> Result<(), Self::Error>where
Self: Sized,
fn put_huffman_encoded<const LOWER_CASE: bool>(
&mut self,
v: &[u8],
) -> Result<(), Self::Error>where
Self: Sized,
Writes v to the output sink after HPACK Huffman-encoding it.
The Huffman code implemented is the one defined for HPACK (RFC7541).
Encoding is not atomic. An error can be returned after writing part of the output, so callers cannot safely retry unless the sink discards the partial output. Sinks that perform irreversible writes, such as sending data over the network, must buffer the output or guarantee success.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".