pub trait DecodeContext: CodecContext {
// Required methods
fn full_data(&self) -> &[u8] ⓘ;
fn remaining_data(&self) -> &[u8] ⓘ;
fn position(&self) -> usize;
fn advance(&mut self, by: usize);
fn restart_from(&mut self, pos: usize) -> Result<(), Self::Error>;
fn error_decoding(
&self,
byte_range: Range<usize>,
reason: Option<&str>,
) -> Self::Error;
// Provided method
fn handle_error<E>(
&mut self,
errors: &E,
byte_range: Range<usize>,
reason: Option<&str>,
) -> Result<Self::StrBuf, Self::Error>
where E: DecodeErrorHandler<Self> { ... }
}Required Methods§
fn full_data(&self) -> &[u8] ⓘ
fn remaining_data(&self) -> &[u8] ⓘ
fn position(&self) -> usize
fn advance(&mut self, by: usize)
fn restart_from(&mut self, pos: usize) -> Result<(), Self::Error>
fn error_decoding( &self, byte_range: Range<usize>, reason: Option<&str>, ) -> Self::Error
Provided Methods§
fn handle_error<E>(
&mut self,
errors: &E,
byte_range: Range<usize>,
reason: Option<&str>,
) -> Result<Self::StrBuf, Self::Error>where
E: DecodeErrorHandler<Self>,
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.