Trait Credentials
pub trait Credentials: Sized {
const SCHEME: &'static str;
// Required methods
fn decode(value: &HeaderValue) -> Option<Self>;
fn encode(&self) -> Option<HeaderValue>;
}Available on crate feature
http only.Expand description
Credentials to be used in the Authorization header.
Required Associated Constants§
Required Methods§
fn decode(value: &HeaderValue) -> Option<Self>
fn decode(value: &HeaderValue) -> Option<Self>
Try to decode the credentials from the HeaderValue.
The SCHEME will be the first part of the value.
fn encode(&self) -> Option<HeaderValue>
fn encode(&self) -> Option<HeaderValue>
Encode the credentials to a HeaderValue.
The SCHEME must be the first part of the value.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".