Struct mas_keystore::JsonWebKey

pub struct JsonWebKey<P> { /* private fields */ }

Implementations§

§

impl<P> JsonWebKey<P>

pub const fn new(parameters: P) -> JsonWebKey<P>

Create a new JsonWebKey with the given parameters.

pub fn try_map<M, O, E>(self, mapper: M) -> Result<JsonWebKey<O>, E>
where M: FnOnce(P) -> Result<O, E>,

Map the parameters of this JsonWebKey to a new type, with a fallible mapper, consuming the original key.

§Errors

Returns an error if the mapper returns an error.

pub fn map<M, O>(self, mapper: M) -> JsonWebKey<O>
where M: FnOnce(P) -> O,

Map the parameters of this JsonWebKey to a new type, consuming the original key.

pub fn try_cloned_map<M, O, E>(&self, mapper: M) -> Result<JsonWebKey<O>, E>
where M: FnOnce(&P) -> Result<O, E>,

Map the parameters of this JsonWebKey to a new type, with a fallible mapper, cloning the other fields.

§Errors

Returns an error if the mapper returns an error.

pub fn cloned_map<M, O>(&self, mapper: M) -> JsonWebKey<O>
where M: FnOnce(&P) -> O,

Map the parameters of this JsonWebKey to a new type, cloning the other fields.

pub fn with_use(self, value: JsonWebKeyUse) -> JsonWebKey<P>

Set the use field of this JsonWebKey.

pub fn with_key_ops(self, key_ops: Vec<JsonWebKeyOperation>) -> JsonWebKey<P>

Set the key_ops field of this JsonWebKey.

pub fn with_alg(self, alg: JsonWebSignatureAlg) -> JsonWebKey<P>

Set the alg field of this JsonWebKey.

pub fn with_kid(self, kid: impl Into<String>) -> JsonWebKey<P>

Set the kid field of this JsonWebKey.

pub const fn alg(&self) -> Option<&JsonWebSignatureAlg>

Get the kid field of this JsonWebKey, if set.

pub const fn params(&self) -> &P

Get the inner parameters of this JsonWebKey.

Trait Implementations§

§

impl<P> Clone for JsonWebKey<P>
where P: Clone,

§

fn clone(&self) -> JsonWebKey<P>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<P> Constrainable for JsonWebKey<P>
where P: ParametersInfo,

§

fn kid(&self) -> Option<&str>

Key ID (kid) of this key
§

fn kty(&self) -> JsonWebKeyType

Key type (kty) of this key
§

fn algs(&self) -> &[JsonWebSignatureAlg]

List of available algorithms for this key
§

fn alg(&self) -> Option<&JsonWebSignatureAlg>

§

fn use_(&self) -> Option<&JsonWebKeyUse>

Usage specified for this key
§

impl<P> Debug for JsonWebKey<P>
where P: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de, P> Deserialize<'de> for JsonWebKey<P>
where P: Deserialize<'de>,

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<JsonWebKey<P>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl<P> FromIterator<JsonWebKey<P>> for JsonWebKeySet<P>

§

fn from_iter<T>(iter: T) -> JsonWebKeySet<P>
where T: IntoIterator<Item = JsonWebKey<P>>,

Creates a value from an iterator. Read more
§

impl<P> JsonSchema for JsonWebKey<P>
where P: JsonSchema,

§

fn schema_name() -> String

The name of the generated JSON Schema. Read more
§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
§

fn json_schema(gen: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
source§

fn is_referenceable() -> bool

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more
§

impl<P> PartialEq for JsonWebKey<P>
where P: PartialEq,

§

fn eq(&self, other: &JsonWebKey<P>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<P> Serialize for JsonWebKey<P>
where P: Serialize,

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl TryFrom<JsonWebKey<JsonWebKeyPrivateParameters>> for JsonWebKey<JsonWebKeyPublicParameters>

§

type Error = SymetricKeyError

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

fn try_from( value: JsonWebKey<JsonWebKeyPrivateParameters>, ) -> Result<JsonWebKey<JsonWebKeyPublicParameters>, <JsonWebKey<JsonWebKeyPublicParameters> as TryFrom<JsonWebKey<JsonWebKeyPrivateParameters>>>::Error>

Performs the conversion.
§

impl<P> Eq for JsonWebKey<P>
where P: Eq,

§

impl<P> StructuralPartialEq for JsonWebKey<P>

Auto Trait Implementations§

§

impl<P> Freeze for JsonWebKey<P>
where P: Freeze,

§

impl<P> RefUnwindSafe for JsonWebKey<P>
where P: RefUnwindSafe,

§

impl<P> Send for JsonWebKey<P>
where P: Send,

§

impl<P> Sync for JsonWebKey<P>
where P: Sync,

§

impl<P> Unpin for JsonWebKey<P>
where P: Unpin,

§

impl<P> UnwindSafe for JsonWebKey<P>
where P: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,