Type Definition jws::header::HeadersRef

source ·
pub type HeadersRef<'a> = AvailableHeaders<&'a JsonObject>;
Expand description

References to the headers of a message.

Implementations

Get the protected header, if it is available.

Get the unprotected header, if it is available.

Get a parameter from either the protected or unprotected header, depending on which are available and which has the parameter.

If a parameter is found in the protected header, the unprotected header is not consulted anymore.

Get a required parameter from either header.

This is almost identical to get, except that this function returns a properly formatter error instead of an empty optional.

Get and deserialize a required parameter from either header.

This function delegates to get_required and deserializes the result into the desired type. Deserialization errors are reported as Error::InvalidHeaderParam.