Skip to main content

ComponentSource

Trait ComponentSource 

Source
pub trait ComponentSource {
    // Required method
    fn component_value(
        &self,
        component: &Component,
    ) -> Result<String, HttpSigError>;
}
Expand description

Something a signature base can read covered component values from.

Requests and response exchanges resolve components differently, but the signature base is built by one piece of code over this trait rather than duplicated per message kind — the base is byte-exact, and two implementations of it would eventually disagree.

Required Methods§

Source

fn component_value(&self, component: &Component) -> Result<String, HttpSigError>

The derived value of component for this message.

§Errors

Returns HttpSigError::MissingComponent if a covered header is absent, or HttpSigError::UnsupportedComponent if the component cannot be derived from this kind of message.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§