pub trait FromMap {
type Error: From<Error>;
type Target;
const SUPPORTS_HEADER_FIELD_SOURCE: bool = false;
// Required method
fn from(
map: &HashMap<CheetahString, CheetahString>,
) -> Result<Self::Target, Self::Error>;
// Provided method
fn from_field_source(
source: &dyn HeaderFieldSource,
) -> Result<Self::Target, Self::Error> { ... }
}Provided Associated Constants§
Sourceconst SUPPORTS_HEADER_FIELD_SOURCE: bool = false
const SUPPORTS_HEADER_FIELD_SOURCE: bool = false
Whether production decode may call Self::from_field_source without
first materializing the compatibility map.
Required Associated Types§
Required Methods§
Sourcefn from(
map: &HashMap<CheetahString, CheetahString>,
) -> Result<Self::Target, Self::Error>
fn from( map: &HashMap<CheetahString, CheetahString>, ) -> Result<Self::Target, Self::Error>
Converts the implementing type from a map.
Returns an instance of Self::Target that is created from the provided map.
Provided Methods§
Sourcefn from_field_source(
source: &dyn HeaderFieldSource,
) -> Result<Self::Target, Self::Error>
fn from_field_source( source: &dyn HeaderFieldSource, ) -> Result<Self::Target, Self::Error>
Converts the implementing type from a borrowed field source.
Generated request-header implementations override this method. The default is an
additive compatibility fallback for existing implementations and is not
selected by production dispatch while the capability remains false.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".