pub struct CoreDocument { /* private fields */ }Expand description
A DID Document.
Implementations§
Source§impl CoreDocument
impl CoreDocument
Sourcepub fn builder(properties: Object) -> DocumentBuilder
pub fn builder(properties: Object) -> DocumentBuilder
Creates a DocumentBuilder to configure a new CoreDocument.
This is the same as DocumentBuilder::new.
Sourcepub fn from_builder(builder: DocumentBuilder) -> Result<Self>
pub fn from_builder(builder: DocumentBuilder) -> Result<Self>
Returns a new CoreDocument based on the DocumentBuilder configuration.
Sourcepub fn id_mut_unchecked(&mut self) -> &mut CoreDID
pub fn id_mut_unchecked(&mut self) -> &mut CoreDID
Returns a mutable reference to the CoreDocument id.
§Warning
Changes to the identifier can drastically alter the results of
Self::resolve_method,
Self::resolve_service and the related DID URL dereferencing algorithm.
Sourcepub fn controller(&self) -> Option<&OneOrSet<CoreDID>>
pub fn controller(&self) -> Option<&OneOrSet<CoreDID>>
Returns a reference to the CoreDocument controller.
Sourcepub fn controller_mut(&mut self) -> &mut Option<OneOrSet<CoreDID>>
pub fn controller_mut(&mut self) -> &mut Option<OneOrSet<CoreDID>>
Returns a mutable reference to the CoreDocument controller.
Sourcepub fn also_known_as(&self) -> &OrderedSet<Url>
pub fn also_known_as(&self) -> &OrderedSet<Url>
Returns a reference to the CoreDocument alsoKnownAs set.
Sourcepub fn also_known_as_mut(&mut self) -> &mut OrderedSet<Url>
pub fn also_known_as_mut(&mut self) -> &mut OrderedSet<Url>
Returns a mutable reference to the CoreDocument alsoKnownAs set.
Sourcepub fn verification_method(&self) -> &OrderedSet<VerificationMethod>
pub fn verification_method(&self) -> &OrderedSet<VerificationMethod>
Returns a reference to the CoreDocument verificationMethod set.
Sourcepub fn authentication(&self) -> &OrderedSet<MethodRef>
pub fn authentication(&self) -> &OrderedSet<MethodRef>
Returns a reference to the CoreDocument authentication set.
Sourcepub fn assertion_method(&self) -> &OrderedSet<MethodRef>
pub fn assertion_method(&self) -> &OrderedSet<MethodRef>
Returns a reference to the CoreDocument assertionMethod set.
Sourcepub fn key_agreement(&self) -> &OrderedSet<MethodRef>
pub fn key_agreement(&self) -> &OrderedSet<MethodRef>
Returns a reference to the CoreDocument keyAgreement set.
Sourcepub fn capability_delegation(&self) -> &OrderedSet<MethodRef>
pub fn capability_delegation(&self) -> &OrderedSet<MethodRef>
Returns a reference to the CoreDocument capabilityDelegation set.
Sourcepub fn capability_invocation(&self) -> &OrderedSet<MethodRef>
pub fn capability_invocation(&self) -> &OrderedSet<MethodRef>
Returns a reference to the CoreDocument capabilityInvocation set.
Sourcepub fn service(&self) -> &OrderedSet<Service>
pub fn service(&self) -> &OrderedSet<Service>
Returns a reference to the CoreDocument service set.
Sourcepub fn service_mut_unchecked(&mut self) -> &mut OrderedSet<Service>
pub fn service_mut_unchecked(&mut self) -> &mut OrderedSet<Service>
§Warning
Changing a service’s identifier can drastically alter the results of
Self::resolve_service and the related DID URL dereferencing algorithm.
Sourcepub fn properties(&self) -> &Object
pub fn properties(&self) -> &Object
Returns a reference to the custom CoreDocument properties.
Sourcepub fn properties_mut_unchecked(&mut self) -> &mut Object
pub fn properties_mut_unchecked(&mut self) -> &mut Object
Returns a mutable reference to the custom CoreDocument properties.
§Warning
The properties returned are not checked against the standard fields in a CoreDocument. Incautious use can have
undesired consequences such as key collision when attempting to serialize the document or distinct resources (such
as services and methods) being identified by the same DID URL.
Sourcepub fn insert_method(
&mut self,
method: VerificationMethod,
scope: MethodScope,
) -> Result<()>
pub fn insert_method( &mut self, method: VerificationMethod, scope: MethodScope, ) -> Result<()>
Adds a new [VerificationMethod] to the document in the given [MethodScope].
§Errors
Returns an error if a method or service with the same fragment already exists.
Sourcepub fn remove_method(&mut self, did_url: &DIDUrl) -> Option<VerificationMethod>
pub fn remove_method(&mut self, did_url: &DIDUrl) -> Option<VerificationMethod>
Removes and returns the [VerificationMethod] identified by did_url from the document.
§Note
All references to the method found in the document will be removed. This includes cases where the reference is to a method contained in another DID document.
Sourcepub fn remove_method_and_scope(
&mut self,
did_url: &DIDUrl,
) -> Option<(VerificationMethod, MethodScope)>
pub fn remove_method_and_scope( &mut self, did_url: &DIDUrl, ) -> Option<(VerificationMethod, MethodScope)>
Removes and returns the [VerificationMethod] from the document. The [MethodScope] under which the method was
found is appended to the second position of the returned tuple.
§Note
All references to the method found in the document will be removed. This includes cases where the reference is to a method contained in another DID document.
Sourcepub fn insert_service(&mut self, service: Service) -> Result<()>
pub fn insert_service(&mut self, service: Service) -> Result<()>
Sourcepub fn remove_service(&mut self, id: &DIDUrl) -> Option<Service>
pub fn remove_service(&mut self, id: &DIDUrl) -> Option<Service>
Removes and returns a Service from the document if it exists.
Sourcepub fn attach_method_relationship<'query, Q>(
&mut self,
method_query: Q,
relationship: MethodRelationship,
) -> Result<bool>where
Q: Into<DIDUrlQuery<'query>>,
pub fn attach_method_relationship<'query, Q>(
&mut self,
method_query: Q,
relationship: MethodRelationship,
) -> Result<bool>where
Q: Into<DIDUrlQuery<'query>>,
Attaches the relationship to the method resolved by method_query.
§Errors
Returns an error if the method does not exist or if it is embedded.
To convert an embedded method into a generic verification method, remove it first
and insert it with [MethodScope::VerificationMethod].
Sourcepub fn detach_method_relationship<'query, Q>(
&mut self,
method_query: Q,
relationship: MethodRelationship,
) -> Result<bool>where
Q: Into<DIDUrlQuery<'query>>,
pub fn detach_method_relationship<'query, Q>(
&mut self,
method_query: Q,
relationship: MethodRelationship,
) -> Result<bool>where
Q: Into<DIDUrlQuery<'query>>,
Detaches the relationship from the method resolved by method_query.
Returns true if the relationship was found and removed, false otherwise.
§Errors
Returns an error if the method does not exist or is embedded.
To remove an embedded method, use Self::remove_method.
§Note
If the method is referenced in the given scope, but the document does not contain the referenced verification method, then the reference will persist in the document (i.e. it is not removed).
Sourcepub fn methods(&self, scope: Option<MethodScope>) -> Vec<&VerificationMethod>
pub fn methods(&self, scope: Option<MethodScope>) -> Vec<&VerificationMethod>
Returns a Vec of verification method references whose verification relationship matches scope.
If scope is None, an iterator over all embedded methods is returned.
Sourcepub fn verification_relationships(&self) -> impl Iterator<Item = &MethodRef>
pub fn verification_relationships(&self) -> impl Iterator<Item = &MethodRef>
Returns an iterator over all verification relationships.
This includes embedded and referenced VerificationMethods.
Sourcepub fn resolve_method<'query, 'me, Q>(
&'me self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&'me VerificationMethod>where
Q: Into<DIDUrlQuery<'query>>,
pub fn resolve_method<'query, 'me, Q>(
&'me self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&'me VerificationMethod>where
Q: Into<DIDUrlQuery<'query>>,
Returns the first [VerificationMethod] with an id property matching the
provided method_query and the verification relationship specified by scope if present.
Sourcepub fn resolve_method_mut<'query, 'me, Q>(
&'me mut self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&'me mut VerificationMethod>where
Q: Into<DIDUrlQuery<'query>>,
pub fn resolve_method_mut<'query, 'me, Q>(
&'me mut self,
method_query: Q,
scope: Option<MethodScope>,
) -> Option<&'me mut VerificationMethod>where
Q: Into<DIDUrlQuery<'query>>,
Returns a mutable reference to the first [VerificationMethod] with an id property
matching the provided method_query.
§Warning
Incorrect use of this method can lead to distinct document resources being identified by the same DID URL.
Sourcepub fn resolve_service<'query, 'me, Q>(
&'me self,
service_query: Q,
) -> Option<&'me Service>where
Q: Into<DIDUrlQuery<'query>>,
pub fn resolve_service<'query, 'me, Q>(
&'me self,
service_query: Q,
) -> Option<&'me Service>where
Q: Into<DIDUrlQuery<'query>>,
Returns the first Service with an id property matching the provided service_query, if present.
Sourcepub fn try_map<F, G, H, L, M, E>(
self,
id_update: F,
controller_update: G,
methods_update: H,
service_update: L,
error_cast: M,
) -> Result<Self, E>
pub fn try_map<F, G, H, L, M, E>( self, id_update: F, controller_update: G, methods_update: H, service_update: L, error_cast: M, ) -> Result<Self, E>
Update the DID components of the document’s id, controllers, methods and services by applying the provided
fallible maps.
This is an advanced method that can be useful for DID methods that do not know the document’s identifier prior to publishing, but should preferably be avoided otherwise.
§Errors
Any error is returned if any of the functions fail or the updates cause scoped method references to embedded
methods, or methods and services with identical identifiers in the document. In the case where illegal identifiers
are detected the supplied the error_cast function gets called in order to convert Error to E.
Sourcepub fn map_unchecked<F, G, H, L>(
self,
id_update: F,
controller_update: G,
methods_update: H,
service_update: L,
) -> Self
pub fn map_unchecked<F, G, H, L>( self, id_update: F, controller_update: G, methods_update: H, service_update: L, ) -> Self
Unchecked version of Self::try_map.
Source§impl CoreDocument
impl CoreDocument
Sourcepub fn verify_jws<'jws, T: JwsVerifier>(
&self,
jws: &'jws str,
detached_payload: Option<&'jws [u8]>,
signature_verifier: &T,
options: &JwsVerificationOptions,
) -> Result<DecodedJws<'jws>>
pub fn verify_jws<'jws, T: JwsVerifier>( &self, jws: &'jws str, detached_payload: Option<&'jws [u8]>, signature_verifier: &T, options: &JwsVerificationOptions, ) -> Result<DecodedJws<'jws>>
Decodes and verifies the provided JWS according to the passed JwsVerificationOptions and
[JwsVerifier].
Regardless of which options are passed the following conditions must be met in order for a verification attempt to take place.
- The JWS must be encoded according to the JWS compact serialization.
- The
kidvalue in the protected header must be an identifier of a verification method in this DID document, or set explicitly in theoptions.
Sourcepub fn verify_jws_hybrid<'jws, TRV: JwsVerifier, PQV: JwsVerifier>(
&self,
jws: &'jws str,
detached_payload: Option<&'jws [u8]>,
traditional_verifier: &TRV,
pq_verifier: &PQV,
options: &JwsVerificationOptions,
) -> Result<DecodedJws<'jws>>
pub fn verify_jws_hybrid<'jws, TRV: JwsVerifier, PQV: JwsVerifier>( &self, jws: &'jws str, detached_payload: Option<&'jws [u8]>, traditional_verifier: &TRV, pq_verifier: &PQV, options: &JwsVerificationOptions, ) -> Result<DecodedJws<'jws>>
Decodes and verifies the provided PQ/T JWS according to the passed JwsVerificationOptions with a
traditional [JwsVerifier] and PQ [JwsVerifier].
Regardless of which options are passed the following conditions must be met in order for a verification attempt to take place.
- The JWS must be encoded according to the JWS compact serialization.
- The
kidvalue in the protected header must be an identifier of a verification method in this DID document, or set explicitly in theoptions.
Source§impl CoreDocument
impl CoreDocument
Sourcepub fn expand_did_jwk(did_jwk: DIDJwk) -> Result<Self, Error>
pub fn expand_did_jwk(did_jwk: DIDJwk) -> Result<Self, Error>
Creates a CoreDocument from a did:jwk DID.
Source§impl CoreDocument
impl CoreDocument
Sourcepub fn expand_did_compositejwk(
did_compositejwk: DIDCompositeJwk,
) -> Result<Self, Error>
pub fn expand_did_compositejwk( did_compositejwk: DIDCompositeJwk, ) -> Result<Self, Error>
Creates a CoreDocument from a did:compositejwk DID.
Trait Implementations§
Source§impl AsRef<CoreDocument> for CoreDocument
impl AsRef<CoreDocument> for CoreDocument
Source§fn as_ref(&self) -> &CoreDocument
fn as_ref(&self) -> &CoreDocument
Source§impl Clone for CoreDocument
impl Clone for CoreDocument
Source§fn clone(&self) -> CoreDocument
fn clone(&self) -> CoreDocument
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CoreDocument
impl Debug for CoreDocument
Source§impl<'de> Deserialize<'de> for CoreDocument
impl<'de> Deserialize<'de> for CoreDocument
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 Display for CoreDocument
impl Display for CoreDocument
Source§impl PartialEq for CoreDocument
impl PartialEq for CoreDocument
Source§impl Serialize for CoreDocument
impl Serialize for CoreDocument
impl Eq for CoreDocument
impl StructuralPartialEq for CoreDocument
Auto Trait Implementations§
impl Freeze for CoreDocument
impl RefUnwindSafe for CoreDocument
impl Send for CoreDocument
impl Sync for CoreDocument
impl Unpin for CoreDocument
impl UnwindSafe for CoreDocument
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read more§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> ConvertTo<T> for Twhere
T: Send,
impl<T> ConvertTo<T> for Twhere
T: Send,
fn convert(self) -> Result<T, Error>
fn convert_unchecked(self) -> T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> FmtJson for Twhere
T: ToJson,
impl<T> FmtJson for Twhere
T: ToJson,
§impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
§fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
Self from a string of JSON text.§fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
Self from bytes of JSON text.§fn from_json_value(json: Value) -> Result<Self, Error>
fn from_json_value(json: Value) -> Result<Self, Error>
Self from a serde_json::Value.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a Request§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.§impl<T> ToJson for Twhere
T: Serialize,
impl<T> ToJson for Twhere
T: Serialize,
§fn to_json_vec(&self) -> Result<Vec<u8>, Error>
fn to_json_vec(&self) -> Result<Vec<u8>, Error>
self as a JSON byte vector.§fn to_json_value(&self) -> Result<Value, Error>
fn to_json_value(&self) -> Result<Value, Error>
self as a serde_json::Value.§fn to_json_pretty(&self) -> Result<String, Error>
fn to_json_pretty(&self) -> Result<String, Error>
self as a pretty-printed string of JSON.§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.