Struct identity_iota::crypto::Proof
source · [−]pub struct Proof {
pub created: Option<Timestamp>,
pub expires: Option<Timestamp>,
pub challenge: Option<String>,
pub domain: Option<String>,
pub purpose: Option<ProofPurpose>,
/* private fields */
}
Expand description
A digital signature.
For field definitions see: the W3C Security Vocabulary specification.
Fields
created: Option<Timestamp>
When the proof was generated.
expires: Option<Timestamp>
When the proof expires.
challenge: Option<String>
Challenge from a proof requester to mitigate replay attacks.
domain: Option<String>
Domain for which a proof is valid to mitigate replay attacks.
purpose: Option<ProofPurpose>
Purpose for which the proof was generated.
Implementations
sourceimpl Proof
impl Proof
sourcepub fn new(type_: impl Into<String>, method: impl Into<String>) -> Proof
pub fn new(type_: impl Into<String>, method: impl Into<String>) -> Proof
Creates a new Proof
instance with the given type_
and method
, with the rest
of its properties left unset.
sourcepub fn new_with_options(
type_: impl Into<String>,
method: impl Into<String>,
options: ProofOptions
) -> Proof
pub fn new_with_options(
type_: impl Into<String>,
method: impl Into<String>,
options: ProofOptions
) -> Proof
Creates a new Proof
instance with the given properties.
sourcepub fn verification_method(&self) -> &str
pub fn verification_method(&self) -> &str
Returns the identifier of the DID method used to create this proof.
sourcepub const fn value(&self) -> &ProofValue
pub const fn value(&self) -> &ProofValue
Returns a reference to the proof value
.
sourcepub fn value_mut(&mut self) -> &mut ProofValue
pub fn value_mut(&mut self) -> &mut ProofValue
Returns a mutable reference to the proof value
.
sourcepub fn set_value(&mut self, value: ProofValue)
pub fn set_value(&mut self, value: ProofValue)
Sets the ProofValue
of the object.
sourcepub fn clear_value(&mut self)
pub fn clear_value(&mut self)
Clears the current proof value - all other properties are unchanged.
sourcepub fn hide_value(&self)
pub fn hide_value(&self)
Flag the proof value so it is ignored during serialization
sourcepub fn show_value(&self)
pub fn show_value(&self)
Restore the proof value state so serialization behaves normally
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Proof
impl<'de> Deserialize<'de> for Proof
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<Proof, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Proof, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<'query> From<&'query Proof> for DIDUrlQuery<'query>
impl<'query> From<&'query Proof> for DIDUrlQuery<'query>
sourcefn from(other: &'query Proof) -> DIDUrlQuery<'query>
fn from(other: &'query Proof) -> DIDUrlQuery<'query>
Converts to this type from the input type.
sourceimpl Ord for Proof
impl Ord for Proof
sourceimpl PartialOrd<Proof> for Proof
impl PartialOrd<Proof> for Proof
sourcefn partial_cmp(&self, other: &Proof) -> Option<Ordering>
fn partial_cmp(&self, other: &Proof) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Serialize for Proof
impl Serialize for Proof
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 Eq for Proof
impl StructuralEq for Proof
impl StructuralPartialEq for Proof
Auto Trait Implementations
impl RefUnwindSafe for Proof
impl Send for Proof
impl Sync for Proof
impl Unpin for Proof
impl UnwindSafe for Proof
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<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
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