pub type PublicJsonWebKey = JsonWebKey<JsonWebKeyPublicParameters>;
Aliased Type§
struct PublicJsonWebKey { /* 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§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: 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 more