Skip to main content

Sigv4

Struct Sigv4 

Source
pub struct Sigv4<'a> {
    pub method: &'a str,
    pub host: &'a str,
    pub canonical_uri: &'a str,
    pub canonical_query: &'a str,
    pub payload: &'a [u8],
    pub region: &'a str,
    pub service: &'a str,
    pub access_key: &'a str,
    pub secret_key: &'a str,
    pub session_token: Option<&'a str>,
    pub amz: AmzDate,
}
Expand description

All inputs needed to sign one request. Pure — no IO — so it is unit tested against AWS’s published example vector.

Fields§

§method: &'a str§host: &'a str§canonical_uri: &'a str

Already URI-encoded absolute path.

§canonical_query: &'a str

Already-canonical query string (sorted, encoded). Empty for none.

§payload: &'a [u8]§region: &'a str§service: &'a str§access_key: &'a str§secret_key: &'a str§session_token: Option<&'a str>§amz: AmzDate

Implementations§

Source§

impl Sigv4<'_>

Source

pub fn signed_headers(&self) -> Vec<(String, String)>

The (name, value) header pairs to attach to the outgoing request (x-amz-date, optional x-amz-security-token, authorization). The host header is not returned — the HTTP client sets it, and it is folded into the signature here using self.host.

Auto Trait Implementations§

§

impl<'a> Freeze for Sigv4<'a>

§

impl<'a> RefUnwindSafe for Sigv4<'a>

§

impl<'a> Send for Sigv4<'a>

§

impl<'a> Sync for Sigv4<'a>

§

impl<'a> Unpin for Sigv4<'a>

§

impl<'a> UnsafeUnpin for Sigv4<'a>

§

impl<'a> UnwindSafe for Sigv4<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.