pub trait Encoder {
// Required methods
fn encoded_len(bin_len: usize) -> Result<usize, Error>;
fn encode<IN: AsRef<[u8]>>(
encoded: &mut [u8],
bin: IN,
) -> Result<&[u8], Error>;
// Provided methods
fn encode_to_str<IN: AsRef<[u8]>>(
encoded: &mut [u8],
bin: IN,
) -> Result<&str, Error> { ... }
fn encode_to_string<IN: AsRef<[u8]>>(bin: IN) -> Result<String, Error> { ... }
}
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.