pub trait EncodableInHeader:
Send
+ Sync
+ Any
+ Debug {
// Required methods
fn encode(
&self,
encoder: &mut EncodingWriter<'_>,
) -> Result<(), EncodingError>;
fn boxed_clone(&self) -> Box<dyn EncodableInHeader>;
}Expand description
Trait Implemented by “components” used in header field bodies
This trait can be turned into a trait object allowing runtime genericallity over the “components” if needed.
Required Methods§
fn encode(&self, encoder: &mut EncodingWriter<'_>) -> Result<(), EncodingError>
fn boxed_clone(&self) -> Box<dyn EncodableInHeader>
Implementations§
Source§impl dyn EncodableInHeader
impl dyn EncodableInHeader
pub fn is<T: EncodableInHeader>(&self) -> bool
pub fn downcast_ref<T: EncodableInHeader>(&self) -> Option<&T>
pub fn downcast_mut<T: EncodableInHeader>(&mut self) -> Option<&mut T>
Trait Implementations§
Source§impl Clone for Box<dyn EncodableInHeader>
impl Clone for Box<dyn EncodableInHeader>
Source§impl EncodableInHeaderBoxExt for Box<dyn EncodableInHeader>
impl EncodableInHeaderBoxExt for Box<dyn EncodableInHeader>
Source§impl EncodableInHeaderBoxExt for Box<dyn EncodableInHeader + Send>
impl EncodableInHeaderBoxExt for Box<dyn EncodableInHeader + Send>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".