Enum identity_iota::verification::MethodData
source · #[non_exhaustive]pub enum MethodData {
PublicKeyMultibase(String),
PublicKeyBase58(String),
PublicKeyJwk(Jwk),
Custom(CustomMethodData),
}
Expand description
Supported verification method data formats.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PublicKeyMultibase(String)
Verification Material in multibase encoding.
PublicKeyBase58(String)
Verification Material in base58 encoding.
PublicKeyJwk(Jwk)
Verification Material in the JSON Web Key format.
Custom(CustomMethodData)
Arbitrary verification material.
Implementations§
source§impl MethodData
impl MethodData
sourcepub fn new_base58(data: impl AsRef<[u8]>) -> MethodData
pub fn new_base58(data: impl AsRef<[u8]>) -> MethodData
Creates a new MethodData
variant with base58-encoded content.
sourcepub fn new_multibase(data: impl AsRef<[u8]>) -> MethodData
pub fn new_multibase(data: impl AsRef<[u8]>) -> MethodData
Creates a new MethodData
variant with Multibase-encoded content.
sourcepub fn new_custom(data: impl Into<CustomMethodData>) -> MethodData
pub fn new_custom(data: impl Into<CustomMethodData>) -> MethodData
Creates a new MethodData
variant from custom data.
sourcepub fn public_key_jwk(&self) -> Option<&Jwk>
pub fn public_key_jwk(&self) -> Option<&Jwk>
Returns the wrapped Jwk
if the format is MethodData::PublicKeyJwk
.
sourcepub fn try_public_key_jwk(&self) -> Result<&Jwk, Error>
pub fn try_public_key_jwk(&self) -> Result<&Jwk, Error>
Fallible version of Self::public_key_jwk
.
sourcepub fn custom(&self) -> Option<&CustomMethodData>
pub fn custom(&self) -> Option<&CustomMethodData>
Returns the custom method data, if any.
Trait Implementations§
source§impl Clone for MethodData
impl Clone for MethodData
source§fn clone(&self) -> MethodData
fn clone(&self) -> MethodData
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for MethodData
impl Debug for MethodData
source§impl<'de> Deserialize<'de> for MethodData
impl<'de> Deserialize<'de> for MethodData
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<MethodData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<MethodData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for MethodData
impl PartialEq for MethodData
source§fn eq(&self, other: &MethodData) -> bool
fn eq(&self, other: &MethodData) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for MethodData
impl Serialize for MethodData
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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 Eq for MethodData
impl StructuralPartialEq for MethodData
Auto Trait Implementations§
impl Freeze for MethodData
impl RefUnwindSafe for MethodData
impl Send for MethodData
impl Sync for MethodData
impl Unpin for MethodData
impl UnwindSafe for MethodData
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
Mutably borrows from an owned value. Read more
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
Compare self to
key
and return true
if they are equal.source§impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
source§fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
Deserialize
Self
from a string of JSON text.source§fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
Deserialize
Self
from bytes of JSON text.source§fn from_json_value(json: Value) -> Result<Self, Error>
fn from_json_value(json: Value) -> Result<Self, Error>
Deserialize
Self
from a serde_json::Value
.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> ToJson for Twhere
T: Serialize,
impl<T> ToJson for Twhere
T: Serialize,
source§fn to_json_value(&self) -> Result<Value, Error>
fn to_json_value(&self) -> Result<Value, Error>
Serialize
self
as a serde_json::Value
.