#[non_exhaustive]pub enum Component {
Method,
TargetUri,
Authority,
Scheme,
Path,
Query,
RequestTarget,
Header(String),
}Expand description
A single component in an RFC 9421 signature base.
The Component::lexical representation is the quoted string that
appears in the signature base and in the Signature-Input: header
inner list.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Method
HTTP method (upper-case).
TargetUri
Full request target URI.
Authority
Authority (host equivalent).
Scheme
Request scheme (http / https).
Path
URI path component.
Query
URI query component including the leading ?. When the
request URI has no query, the canonical value is the
single character ? per RFC 9421 §2.2.7.
RequestTarget
@request-target derived component: path and query of the
request target, without the method, per
RFC 9421 §2.2.5. This is semantically distinct from
Cavage’s (request-target) pseudo-header which does include
the method; the Cavage signer / verifier handles that shape
in [crate::cavage] independently.
Header(String)
An ordinary lower-cased HTTP header name.
Implementations§
Source§impl Component
impl Component
Sourcepub fn lexical(&self) -> String
pub fn lexical(&self) -> String
Returns the quoted lexical form that appears in a Signature-Input:
inner list and in the signature base.
Sourcepub fn identifier(&self) -> &str
pub fn identifier(&self) -> &str
Returns the raw identifier without quotes.
Sourcepub fn parse(identifier: &str) -> Result<Self, Error>
pub fn parse(identifier: &str) -> Result<Self, Error>
Parses an identifier back into a Component.
§Errors
Returns Error::UnsupportedAlgorithm for any @-prefixed
identifier that is not one of the seven supported derived
components (@method, @target-uri, @authority, @scheme,
@path, @query, @request-target). Header names are accepted
verbatim and lower-cased.
Trait Implementations§
impl Eq for Component
impl StructuralPartialEq for Component
Auto Trait Implementations§
impl Freeze for Component
impl RefUnwindSafe for Component
impl Send for Component
impl Sync for Component
impl Unpin for Component
impl UnsafeUnpin for Component
impl UnwindSafe for Component
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.