Struct mas_jose::jwk::JsonWebKey
source · pub struct JsonWebKey<P> { /* private fields */ }
Implementations§
source§impl<P> JsonWebKey<P>
impl<P> JsonWebKey<P>
sourcepub const fn new(parameters: P) -> Self
pub const fn new(parameters: P) -> Self
Create a new JsonWebKey
with the given parameters.
sourcepub fn try_map<M, O, E>(self, mapper: M) -> Result<JsonWebKey<O>, E>
pub fn try_map<M, O, E>(self, mapper: M) -> Result<JsonWebKey<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.
sourcepub fn map<M, O>(self, mapper: M) -> JsonWebKey<O>where
M: FnOnce(P) -> O,
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.
sourcepub fn try_cloned_map<M, O, E>(&self, mapper: M) -> Result<JsonWebKey<O>, E>
pub fn try_cloned_map<M, O, E>(&self, mapper: M) -> Result<JsonWebKey<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.
sourcepub fn cloned_map<M, O>(&self, mapper: M) -> JsonWebKey<O>
pub fn cloned_map<M, O>(&self, mapper: M) -> JsonWebKey<O>
Map the parameters of this JsonWebKey
to a new type, cloning the
other fields.
sourcepub fn with_use(self, value: JsonWebKeyUse) -> Self
pub fn with_use(self, value: JsonWebKeyUse) -> Self
Set the use
field of this JsonWebKey
.
sourcepub fn with_key_ops(self, key_ops: Vec<JsonWebKeyOperation>) -> Self
pub fn with_key_ops(self, key_ops: Vec<JsonWebKeyOperation>) -> Self
Set the key_ops
field of this JsonWebKey
.
sourcepub fn with_alg(self, alg: JsonWebSignatureAlg) -> Self
pub fn with_alg(self, alg: JsonWebSignatureAlg) -> Self
Set the alg
field of this JsonWebKey
.
sourcepub fn with_kid(self, kid: impl Into<String>) -> Self
pub fn with_kid(self, kid: impl Into<String>) -> Self
Set the kid
field of this JsonWebKey
.
sourcepub const fn alg(&self) -> Option<&JsonWebSignatureAlg>
pub const fn alg(&self) -> Option<&JsonWebSignatureAlg>
Get the kid
field of this JsonWebKey
, if set.
sourcepub const fn params(&self) -> &P
pub const fn params(&self) -> &P
Get the inner parameters of this JsonWebKey
.
Trait Implementations§
source§impl<P: Clone> Clone for JsonWebKey<P>
impl<P: Clone> Clone for JsonWebKey<P>
source§fn clone(&self) -> JsonWebKey<P>
fn clone(&self) -> JsonWebKey<P>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<P> Constrainable for JsonWebKey<P>where
P: ParametersInfo,
impl<P> Constrainable for JsonWebKey<P>where
P: ParametersInfo,
source§fn kty(&self) -> JsonWebKeyType
fn kty(&self) -> JsonWebKeyType
kty
) of this keysource§fn algs(&self) -> &[JsonWebSignatureAlg]
fn algs(&self) -> &[JsonWebSignatureAlg]
fn alg(&self) -> Option<&JsonWebSignatureAlg>
source§fn use_(&self) -> Option<&JsonWebKeyUse>
fn use_(&self) -> Option<&JsonWebKeyUse>
source§impl<P: Debug> Debug for JsonWebKey<P>
impl<P: Debug> Debug for JsonWebKey<P>
source§impl<'de, P> Deserialize<'de> for JsonWebKey<P>where
P: Deserialize<'de>,
impl<'de, P> Deserialize<'de> for JsonWebKey<P>where
P: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<P> FromIterator<JsonWebKey<P>> for JsonWebKeySet<P>
impl<P> FromIterator<JsonWebKey<P>> for JsonWebKeySet<P>
source§fn from_iter<T: IntoIterator<Item = JsonWebKey<P>>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = JsonWebKey<P>>>(iter: T) -> Self
source§impl<P: JsonSchema> JsonSchema for JsonWebKey<P>
impl<P: JsonSchema> JsonSchema for JsonWebKey<P>
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moresource§impl<P: PartialEq> PartialEq for JsonWebKey<P>
impl<P: PartialEq> PartialEq for JsonWebKey<P>
source§impl<P> Serialize for JsonWebKey<P>where
P: Serialize,
impl<P> Serialize for JsonWebKey<P>where
P: Serialize,
impl<P: Eq> Eq for JsonWebKey<P>
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> 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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.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.source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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