pub trait EncodeContext: CodecContext {
// Required methods
fn full_data(&self) -> &Wtf8;
fn data_len(&self) -> StrSize;
fn remaining_data(&self) -> &Wtf8;
fn position(&self) -> StrSize;
fn restart_from(&mut self, pos: StrSize) -> Result<(), Self::Error>;
fn error_encoding(
&self,
range: Range<StrSize>,
reason: Option<&str>,
) -> Self::Error;
// Provided method
fn handle_error<E>(
&mut self,
errors: &E,
range: Range<StrSize>,
reason: Option<&str>,
) -> Result<EncodeReplace<Self>, Self::Error>
where E: EncodeErrorHandler<Self> { ... }
}Required Methods§
fn full_data(&self) -> &Wtf8
fn data_len(&self) -> StrSize
fn remaining_data(&self) -> &Wtf8
fn position(&self) -> StrSize
fn restart_from(&mut self, pos: StrSize) -> Result<(), Self::Error>
fn error_encoding( &self, range: Range<StrSize>, reason: Option<&str>, ) -> Self::Error
Provided Methods§
fn handle_error<E>(
&mut self,
errors: &E,
range: Range<StrSize>,
reason: Option<&str>,
) -> Result<EncodeReplace<Self>, Self::Error>where
E: EncodeErrorHandler<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.