Struct identity_iota::did::VerificationMethod
source · [−]pub struct VerificationMethod<D = CoreDID, T = BTreeMap<String, Value, Global>> where
D: DID, { /* private fields */ }
Expand description
A DID Document Verification Method.
Implementations
sourceimpl<D, T> VerificationMethod<D, T> where
D: DID,
impl<D, T> VerificationMethod<D, T> where
D: DID,
sourcepub fn builder(properties: T) -> MethodBuilder<D, T>
pub fn builder(properties: T) -> MethodBuilder<D, T>
Creates a MethodBuilder
to configure a new Method
.
This is the same as MethodBuilder::new()
.
sourcepub fn from_builder(
builder: MethodBuilder<D, T>
) -> Result<VerificationMethod<D, T>, Error>
pub fn from_builder(
builder: MethodBuilder<D, T>
) -> Result<VerificationMethod<D, T>, Error>
Returns a new Method
based on the MethodBuilder
configuration.
sourcepub fn set_id(&mut self, id: DIDUrl<D>) -> Result<(), Error>
pub fn set_id(&mut self, id: DIDUrl<D>) -> Result<(), Error>
Sets the VerificationMethod
id.
Errors
Error::MissingIdFragment
if there is no fragment on the DIDUrl
.
sourcepub fn controller(&self) -> &D
pub fn controller(&self) -> &D
Returns a reference to the verification Method
controller.
sourcepub fn controller_mut(&mut self) -> &mut D
pub fn controller_mut(&mut self) -> &mut D
Returns a mutable reference to the verification Method
controller.
sourcepub fn type_(&self) -> MethodType
pub fn type_(&self) -> MethodType
Returns a reference to the verification Method
type.
sourcepub fn type_mut(&mut self) -> &mut MethodType
pub fn type_mut(&mut self) -> &mut MethodType
Returns a mutable reference to the verification Method
type.
sourcepub fn data(&self) -> &MethodData
pub fn data(&self) -> &MethodData
Returns a reference to the verification Method
data.
sourcepub fn data_mut(&mut self) -> &mut MethodData
pub fn data_mut(&mut self) -> &mut MethodData
Returns a mutable reference to the verification Method
data.
sourcepub fn properties(&self) -> &T
pub fn properties(&self) -> &T
Returns a reference to the custom verification Method
properties.
sourcepub fn properties_mut(&mut self) -> &mut T
pub fn properties_mut(&mut self) -> &mut T
Returns a mutable reference to the custom verification Method
properties.
sourcepub fn into_method_ref(self) -> MethodRef<D, T>
pub fn into_method_ref(self) -> MethodRef<D, T>
Creates a new MethodRef
from self
.
sourcepub fn map<C, F>(self, f: F) -> VerificationMethod<C, T> where
C: DID,
F: FnMut(D) -> C,
pub fn map<C, F>(self, f: F) -> VerificationMethod<C, T> where
C: DID,
F: FnMut(D) -> C,
Maps VerificationMethod<D,T>
to VerificationMethod<C,T>
by applying a function f
to
the id and controller.
sourcepub fn try_map<C, F, E>(self, f: F) -> Result<VerificationMethod<C, T>, E> where
C: DID,
F: FnMut(D) -> Result<C, E>,
pub fn try_map<C, F, E>(self, f: F) -> Result<VerificationMethod<C, T>, E> where
C: DID,
F: FnMut(D) -> Result<C, E>,
Fallible version of VerificationMethod::map
.
sourceimpl<D, T> VerificationMethod<D, T> where
D: DID,
T: Default,
impl<D, T> VerificationMethod<D, T> where
D: DID,
T: Default,
sourcepub fn new(
did: D,
key_type: KeyType,
public_key: &Key<Public>,
fragment: &str
) -> Result<VerificationMethod<D, T>, Error>
pub fn new(
did: D,
key_type: KeyType,
public_key: &Key<Public>,
fragment: &str
) -> Result<VerificationMethod<D, T>, Error>
Creates a new VerificationMethod
from the given did
and public key.
Trait Implementations
sourceimpl<D, T> AsRef<DIDUrl<D>> for VerificationMethod<D, T> where
D: DID,
impl<D, T> AsRef<DIDUrl<D>> for VerificationMethod<D, T> where
D: DID,
sourceimpl<D, T> Clone for VerificationMethod<D, T> where
D: Clone + DID,
T: Clone,
impl<D, T> Clone for VerificationMethod<D, T> where
D: Clone + DID,
T: Clone,
sourcefn clone(&self) -> VerificationMethod<D, T>
fn clone(&self) -> VerificationMethod<D, T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'de, D, T> Deserialize<'de> for VerificationMethod<D, T> where
D: DID + Deserialize<'de>,
T: Deserialize<'de>,
impl<'de, D, T> Deserialize<'de> for VerificationMethod<D, T> where
D: DID + Deserialize<'de>,
T: Deserialize<'de>,
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<VerificationMethod<D, T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<VerificationMethod<D, T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<D, T> Diff for VerificationMethod<D, T> where
D: Diff + DID + Serialize + for<'de> Deserialize<'de>,
T: Diff + Serialize + for<'de> Deserialize<'de> + Default,
impl<D, T> Diff for VerificationMethod<D, T> where
D: Diff + DID + Serialize + for<'de> Deserialize<'de>,
T: Diff + Serialize + for<'de> Deserialize<'de> + Default,
type Type = DiffMethod<D, T>
type Type = DiffMethod<D, T>
diff chain features are slated for removal
The Corresponding Diff Type for the implemented Type.
sourcefn diff(
&self,
other: &VerificationMethod<D, T>
) -> Result<<VerificationMethod<D, T> as Diff>::Type, Error>
fn diff(
&self,
other: &VerificationMethod<D, T>
) -> Result<<VerificationMethod<D, T> as Diff>::Type, Error>
diff chain features are slated for removal
Finds the difference between two types; self
and other
and returns Self::Type
sourcefn merge(
&self,
diff: <VerificationMethod<D, T> as Diff>::Type
) -> Result<VerificationMethod<D, T>, Error>
fn merge(
&self,
diff: <VerificationMethod<D, T> as Diff>::Type
) -> Result<VerificationMethod<D, T>, Error>
diff chain features are slated for removal
Merges a Self::Type
with Self
sourcefn from_diff(
diff: <VerificationMethod<D, T> as Diff>::Type
) -> Result<VerificationMethod<D, T>, Error>
fn from_diff(
diff: <VerificationMethod<D, T> as Diff>::Type
) -> Result<VerificationMethod<D, T>, Error>
diff chain features are slated for removal
Converts a diff
of type Self::Type
to a Self
.
sourceimpl<D, T> From<VerificationMethod<D, T>> for MethodRef<D, T> where
D: DID,
impl<D, T> From<VerificationMethod<D, T>> for MethodRef<D, T> where
D: DID,
sourcefn from(other: VerificationMethod<D, T>) -> MethodRef<D, T>
fn from(other: VerificationMethod<D, T>) -> MethodRef<D, T>
Converts to this type from the input type.
sourceimpl<D, T> KeyComparable for VerificationMethod<D, T> where
D: DID,
impl<D, T> KeyComparable for VerificationMethod<D, T> where
D: DID,
sourcefn key(&self) -> &<VerificationMethod<D, T> as KeyComparable>::Key
fn key(&self) -> &<VerificationMethod<D, T> as KeyComparable>::Key
Returns a reference to the key.
sourceimpl<D, T> PartialEq<VerificationMethod<D, T>> for VerificationMethod<D, T> where
D: PartialEq<D> + DID,
T: PartialEq<T>,
impl<D, T> PartialEq<VerificationMethod<D, T>> for VerificationMethod<D, T> where
D: PartialEq<D> + DID,
T: PartialEq<T>,
sourcefn eq(&self, other: &VerificationMethod<D, T>) -> bool
fn eq(&self, other: &VerificationMethod<D, T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &VerificationMethod<D, T>) -> bool
fn ne(&self, other: &VerificationMethod<D, T>) -> bool
This method tests for !=
.
sourceimpl<D, T> Serialize for VerificationMethod<D, T> where
D: DID + Serialize,
T: Serialize,
impl<D, T> Serialize for VerificationMethod<D, T> where
D: DID + Serialize,
T: Serialize,
sourcefn 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<D, T> StructuralPartialEq for VerificationMethod<D, T> where
D: DID,
Auto Trait Implementations
impl<D, T> RefUnwindSafe for VerificationMethod<D, T> where
D: RefUnwindSafe,
T: RefUnwindSafe,
impl<D, T> Send for VerificationMethod<D, T> where
D: Send,
T: Send,
impl<D, T> Sync for VerificationMethod<D, T> where
D: Sync,
T: Sync,
impl<D, T> Unpin for VerificationMethod<D, T> where
D: Unpin,
T: Unpin,
impl<D, T> UnwindSafe for VerificationMethod<D, T> where
D: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FromJson for T where
T: for<'de> Deserialize<'de>,
impl<T> FromJson for T where
T: for<'de> Deserialize<'de>,
sourcefn from_json(json: &impl AsRef<str>) -> Result<Self, Error>
fn from_json(json: &impl AsRef<str>) -> Result<Self, Error>
Deserialize Self
from a string of JSON text.
sourcefn from_json_slice(json: &impl AsRef<[u8]>) -> Result<Self, Error>
fn from_json_slice(json: &impl AsRef<[u8]>) -> Result<Self, Error>
Deserialize Self
from bytes of JSON text.
sourcefn from_json_value(json: Value) -> Result<Self, Error>
fn from_json_value(json: Value) -> Result<Self, Error>
Deserialize Self
from a [serde_json::Value
].
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToJson for T where
T: Serialize,
impl<T> ToJson for T where
T: Serialize,
sourcefn to_json_value(&self) -> Result<Value, Error>
fn to_json_value(&self) -> Result<Value, Error>
Serialize self
as a [serde_json::Value
].
sourcefn to_json_pretty(&self) -> Result<String, Error>
fn to_json_pretty(&self) -> Result<String, Error>
Serialize self
as a pretty-printed string of JSON.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more