pub trait TryEncode: TrySize + Sized {
// Required method
fn try_write<'a, W: Sink>(
&self,
writer: Writer<'a, W>,
) -> ControlFlow<Failure<'a, W>, Writer<'a, W>>;
// Provided methods
fn try_append(&self, out: &mut Vec<u8>) -> Result<(), EncodeError> { ... }
fn try_encode(&self) -> Result<Vec<u8>, EncodeError> { ... }
}Required Methods§
fn try_write<'a, W: Sink>( &self, writer: Writer<'a, W>, ) -> ControlFlow<Failure<'a, W>, Writer<'a, W>>
Provided Methods§
Sourcefn try_append(&self, out: &mut Vec<u8>) -> Result<(), EncodeError>
fn try_append(&self, out: &mut Vec<u8>) -> Result<(), EncodeError>
Admits and writes one exact suffix, preserving the original prefix on failure.
fn try_encode(&self) -> Result<Vec<u8>, EncodeError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".