pub trait Code<T>: Sized {
type Item;
// Required methods
fn code(&mut self, item: T) -> Result<Option<Self::Item>>;
fn code_eof(&mut self) -> Result<Option<Self::Item>>;
// Provided methods
fn is_end_stream(&self, body: &impl Body) -> bool { ... }
fn size_hint(&self, body: &impl Body) -> SizeHint { ... }
}Required Associated Types§
Required Methods§
fn code(&mut self, item: T) -> Result<Option<Self::Item>>
fn code_eof(&mut self) -> Result<Option<Self::Item>>
Provided Methods§
Sourcefn is_end_stream(&self, body: &impl Body) -> bool
fn is_end_stream(&self, body: &impl Body) -> bool
A helper method for overriding associated input body’s end_stream state.
by default it returns value the same as Body::is_end_stream’s default value.
in other word the default prediction is (de)compress can not hint if body has ended.
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.