Struct did::did_details::DidDetails
source · pub struct DidDetails<T: Config> {
pub authentication_key: KeyIdOf<T>,
pub key_agreement_keys: BoundedBTreeSet<KeyIdOf<T>, <T as Config>::MaxTotalKeyAgreementKeys>,
pub delegation_key: Option<KeyIdOf<T>>,
pub attestation_key: Option<KeyIdOf<T>>,
pub public_keys: BoundedBTreeMap<KeyIdOf<T>, DidPublicKeyDetails<BlockNumberFor<T>, AccountIdOf<T>>, <T as Config>::MaxPublicKeysPerDid>,
pub last_tx_counter: u64,
pub deposit: Deposit<AccountIdOf<T>, BalanceOf<T>>,
}
Expand description
The details associated to a DID identity.
Fields§
§authentication_key: KeyIdOf<T>
The ID of the authentication key, used to authenticate DID-related operations.
key_agreement_keys: BoundedBTreeSet<KeyIdOf<T>, <T as Config>::MaxTotalKeyAgreementKeys>
The set of the key agreement key IDs, which can be used to encrypt data addressed to the DID subject.
delegation_key: Option<KeyIdOf<T>>
[OPTIONAL] The ID of the delegation key, used to verify the signatures of the delegations created by the DID subject.
attestation_key: Option<KeyIdOf<T>>
[OPTIONAL] The ID of the attestation key, used to verify the signatures of the attestations created by the DID subject.
public_keys: BoundedBTreeMap<KeyIdOf<T>, DidPublicKeyDetails<BlockNumberFor<T>, AccountIdOf<T>>, <T as Config>::MaxPublicKeysPerDid>
The map of public keys, with the key label as the key map and the tuple (key, addition_block_number) as the map value. The map includes all the keys under the control of the DID subject, including the ones currently used for authentication, key agreement, attestation, and delegation. Other than those, the map also contains the old attestation keys that have been rotated, i.e., they cannot be used to create new attestations but can still be used to verify previously issued attestations.
last_tx_counter: u64
The counter used to avoid replay attacks, which is checked and updated upon each DID operation involving with the subject as the creator.
deposit: Deposit<AccountIdOf<T>, BalanceOf<T>>
The deposit that was taken to incentivise fair use of the on chain storage.
Implementations§
source§impl<T: Config> DidDetails<T>
impl<T: Config> DidDetails<T>
sourcepub fn new(
authentication_key: DidVerificationKey<AccountIdOf<T>>,
block_number: BlockNumberFor<T>,
deposit_owner: AccountIdOf<T>
) -> Result<Self, StorageError>
pub fn new( authentication_key: DidVerificationKey<AccountIdOf<T>>, block_number: BlockNumberFor<T>, deposit_owner: AccountIdOf<T> ) -> Result<Self, StorageError>
Creates a new instance of DID details with the minimum information, i.e., an authentication key and the block creation time.
The tx counter is automatically set to 0.
sourcepub fn calculate_deposit(&self, endpoint_count: u32) -> BalanceOf<T>
pub fn calculate_deposit(&self, endpoint_count: u32) -> BalanceOf<T>
Calculate the deposit that should be secured for the DID based on the number of keys and service endpoints.
Since service endpoints are not stored inside the DidDetails, the number of endpoints need to be provided.
sourcepub fn new_with_creation_details(
details: DidCreationDetails<DidIdentifierOf<T>, AccountIdOf<T>, <T as Config>::MaxNewKeyAgreementKeys, DidEndpoint<T>>,
new_auth_key: DidVerificationKey<AccountIdOf<T>>
) -> Result<Self, DidError>
pub fn new_with_creation_details( details: DidCreationDetails<DidIdentifierOf<T>, AccountIdOf<T>, <T as Config>::MaxNewKeyAgreementKeys, DidEndpoint<T>>, new_auth_key: DidVerificationKey<AccountIdOf<T>> ) -> Result<Self, DidError>
Creates a new DID entry from some DidCreationDetails and a given authentication key.
sourcepub fn update_authentication_key(
&mut self,
new_authentication_key: DidVerificationKey<AccountIdOf<T>>,
block_number: BlockNumberFor<T>
) -> Result<(), StorageError>
pub fn update_authentication_key( &mut self, new_authentication_key: DidVerificationKey<AccountIdOf<T>>, block_number: BlockNumberFor<T> ) -> Result<(), StorageError>
Update the DID authentication key.
The old key is deleted from the set of public keys if it is not used in any other part of the DID. The new key is added to the set of public keys.
sourcepub fn add_key_agreement_keys(
&mut self,
new_key_agreement_keys: BoundedBTreeSet<DidEncryptionKey, T::MaxNewKeyAgreementKeys>,
block_number: BlockNumberFor<T>
) -> Result<(), StorageError>
pub fn add_key_agreement_keys( &mut self, new_key_agreement_keys: BoundedBTreeSet<DidEncryptionKey, T::MaxNewKeyAgreementKeys>, block_number: BlockNumberFor<T> ) -> Result<(), StorageError>
Add new key agreement keys to the DID.
The new keys are added to the set of public keys.
sourcepub fn add_key_agreement_key(
&mut self,
new_key_agreement_key: DidEncryptionKey,
block_number: BlockNumberFor<T>
) -> Result<(), StorageError>
pub fn add_key_agreement_key( &mut self, new_key_agreement_key: DidEncryptionKey, block_number: BlockNumberFor<T> ) -> Result<(), StorageError>
Add a single new key agreement key to the DID.
The new key is added to the set of public keys.
sourcepub fn remove_key_agreement_key(
&mut self,
key_id: KeyIdOf<T>
) -> Result<(), StorageError>
pub fn remove_key_agreement_key( &mut self, key_id: KeyIdOf<T> ) -> Result<(), StorageError>
Remove a key agreement key from both the set of key agreement keys and the one of public keys.
sourcepub fn update_attestation_key(
&mut self,
new_attestation_key: DidVerificationKey<AccountIdOf<T>>,
block_number: BlockNumberFor<T>
) -> Result<(), StorageError>
pub fn update_attestation_key( &mut self, new_attestation_key: DidVerificationKey<AccountIdOf<T>>, block_number: BlockNumberFor<T> ) -> Result<(), StorageError>
Update the DID attestation key, replacing the old one with the new one.
The old key is deleted from the set of public keys if it is not used in any other part of the DID. The new key is added to the set of public keys.
sourcepub fn remove_attestation_key(&mut self) -> Result<(), StorageError>
pub fn remove_attestation_key(&mut self) -> Result<(), StorageError>
Remove the DID attestation key.
The old key is deleted from the set of public keys if it is not used in any other part of the DID. The new key is added to the set of public keys.
sourcepub fn update_delegation_key(
&mut self,
new_delegation_key: DidVerificationKey<AccountIdOf<T>>,
block_number: BlockNumberFor<T>
) -> Result<(), StorageError>
pub fn update_delegation_key( &mut self, new_delegation_key: DidVerificationKey<AccountIdOf<T>>, block_number: BlockNumberFor<T> ) -> Result<(), StorageError>
Update the DID delegation key, replacing the old one with the new one.
The old key is deleted from the set of public keys if it is not used in any other part of the DID. The new key is added to the set of public keys.
sourcepub fn remove_delegation_key(&mut self) -> Result<(), StorageError>
pub fn remove_delegation_key(&mut self) -> Result<(), StorageError>
Remove the DID delegation key.
The old key is deleted from the set of public keys if it is not used in any other part of the DID. The new key is added to the set of public keys.
sourcepub fn remove_key_if_unused(&mut self, key_id: KeyIdOf<T>)
pub fn remove_key_if_unused(&mut self, key_id: KeyIdOf<T>)
Remove a key from the map of public keys if none of the other keys, i.e., authentication, key agreement, attestation, or delegation, is referencing it.
sourcepub fn get_verification_key_for_key_type(
&self,
key_type: DidVerificationKeyRelationship
) -> Option<&DidVerificationKey<AccountIdOf<T>>>
pub fn get_verification_key_for_key_type( &self, key_type: DidVerificationKeyRelationship ) -> Option<&DidVerificationKey<AccountIdOf<T>>>
Returns a reference to a specific verification key given the type of the key needed.
sourcepub fn increase_tx_counter(&mut self) -> u64
pub fn increase_tx_counter(&mut self) -> u64
Increase the tx counter of the DID.
Trait Implementations§
source§impl<T: Clone + Config> Clone for DidDetails<T>
impl<T: Clone + Config> Clone for DidDetails<T>
source§fn clone(&self) -> DidDetails<T>
fn clone(&self) -> DidDetails<T>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<T: Config> Decode for DidDetails<T>where
KeyIdOf<T>: Decode,
BoundedBTreeSet<KeyIdOf<T>, <T as Config>::MaxTotalKeyAgreementKeys>: Decode,
Option<KeyIdOf<T>>: Decode,
BoundedBTreeMap<KeyIdOf<T>, DidPublicKeyDetails<BlockNumberFor<T>, AccountIdOf<T>>, <T as Config>::MaxPublicKeysPerDid>: Decode,
Deposit<AccountIdOf<T>, BalanceOf<T>>: Decode,
impl<T: Config> Decode for DidDetails<T>where KeyIdOf<T>: Decode, BoundedBTreeSet<KeyIdOf<T>, <T as Config>::MaxTotalKeyAgreementKeys>: Decode, Option<KeyIdOf<T>>: Decode, BoundedBTreeMap<KeyIdOf<T>, DidPublicKeyDetails<BlockNumberFor<T>, AccountIdOf<T>>, <T as Config>::MaxPublicKeysPerDid>: Decode, Deposit<AccountIdOf<T>, BalanceOf<T>>: Decode,
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self> ) -> Result<DecodeFinished, Error>where I: Input,
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where I: Input,
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
source§impl<T: Config> Encode for DidDetails<T>where
KeyIdOf<T>: Encode,
BoundedBTreeSet<KeyIdOf<T>, <T as Config>::MaxTotalKeyAgreementKeys>: Encode,
Option<KeyIdOf<T>>: Encode,
BoundedBTreeMap<KeyIdOf<T>, DidPublicKeyDetails<BlockNumberFor<T>, AccountIdOf<T>>, <T as Config>::MaxPublicKeysPerDid>: Encode,
Deposit<AccountIdOf<T>, BalanceOf<T>>: Encode,
impl<T: Config> Encode for DidDetails<T>where KeyIdOf<T>: Encode, BoundedBTreeSet<KeyIdOf<T>, <T as Config>::MaxTotalKeyAgreementKeys>: Encode, Option<KeyIdOf<T>>: Encode, BoundedBTreeMap<KeyIdOf<T>, DidPublicKeyDetails<BlockNumberFor<T>, AccountIdOf<T>>, <T as Config>::MaxPublicKeysPerDid>: Encode, Deposit<AccountIdOf<T>, BalanceOf<T>>: Encode,
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere F: FnOnce(&[u8]) -> R,
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl<T: Config> MaxEncodedLen for DidDetails<T>
impl<T: Config> MaxEncodedLen for DidDetails<T>
source§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
source§impl<T: PartialEq + Config> PartialEq<DidDetails<T>> for DidDetails<T>
impl<T: PartialEq + Config> PartialEq<DidDetails<T>> for DidDetails<T>
source§fn eq(&self, other: &DidDetails<T>) -> bool
fn eq(&self, other: &DidDetails<T>) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl<T> TypeInfo for DidDetails<T>where
KeyIdOf<T>: TypeInfo + 'static,
BoundedBTreeSet<KeyIdOf<T>, <T as Config>::MaxTotalKeyAgreementKeys>: TypeInfo + 'static,
Option<KeyIdOf<T>>: TypeInfo + 'static,
BoundedBTreeMap<KeyIdOf<T>, DidPublicKeyDetails<BlockNumberFor<T>, AccountIdOf<T>>, <T as Config>::MaxPublicKeysPerDid>: TypeInfo + 'static,
Deposit<AccountIdOf<T>, BalanceOf<T>>: TypeInfo + 'static,
T: Config + 'static,
impl<T> TypeInfo for DidDetails<T>where KeyIdOf<T>: TypeInfo + 'static, BoundedBTreeSet<KeyIdOf<T>, <T as Config>::MaxTotalKeyAgreementKeys>: TypeInfo + 'static, Option<KeyIdOf<T>>: TypeInfo + 'static, BoundedBTreeMap<KeyIdOf<T>, DidPublicKeyDetails<BlockNumberFor<T>, AccountIdOf<T>>, <T as Config>::MaxPublicKeysPerDid>: TypeInfo + 'static, Deposit<AccountIdOf<T>, BalanceOf<T>>: TypeInfo + 'static, T: Config + 'static,
impl<T: Config> EncodeLike<DidDetails<T>> for DidDetails<T>where KeyIdOf<T>: Encode, BoundedBTreeSet<KeyIdOf<T>, <T as Config>::MaxTotalKeyAgreementKeys>: Encode, Option<KeyIdOf<T>>: Encode, BoundedBTreeMap<KeyIdOf<T>, DidPublicKeyDetails<BlockNumberFor<T>, AccountIdOf<T>>, <T as Config>::MaxPublicKeysPerDid>: Encode, Deposit<AccountIdOf<T>, BalanceOf<T>>: Encode,
impl<T: Config> StructuralPartialEq for DidDetails<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for DidDetails<T>where <T as Config>::AccountId: RefUnwindSafe, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance: RefUnwindSafe, <T as Config>::Hash: RefUnwindSafe, <T as Config>::MaxPublicKeysPerDid: RefUnwindSafe, <T as Config>::MaxTotalKeyAgreementKeys: RefUnwindSafe, <<<T as Config>::Block as Block>::Header as Header>::Number: RefUnwindSafe,
impl<T> Send for DidDetails<T>where <T as Config>::MaxPublicKeysPerDid: Send, <T as Config>::MaxTotalKeyAgreementKeys: Send,
impl<T> Sync for DidDetails<T>where <T as Config>::MaxPublicKeysPerDid: Sync, <T as Config>::MaxTotalKeyAgreementKeys: Sync,
impl<T> Unpin for DidDetails<T>where <T as Config>::AccountId: Unpin, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance: Unpin, <T as Config>::Hash: Unpin, <T as Config>::MaxPublicKeysPerDid: Unpin, <T as Config>::MaxTotalKeyAgreementKeys: Unpin,
impl<T> UnwindSafe for DidDetails<T>where <T as Config>::AccountId: UnwindSafe + RefUnwindSafe, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance: UnwindSafe, <T as Config>::Hash: UnwindSafe + RefUnwindSafe, <T as Config>::MaxPublicKeysPerDid: UnwindSafe, <T as Config>::MaxTotalKeyAgreementKeys: UnwindSafe, <<<T as Config>::Block as Block>::Header as Header>::Number: RefUnwindSafe,
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
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where Self: TryInto<T>,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> DecodeAll for Twhere
T: Decode,
impl<T> DecodeAll for Twhere T: Decode,
§fn decode_all(input: &mut &[u8]) -> Result<T, Error>
fn decode_all(input: &mut &[u8]) -> Result<T, Error>
Self
and consume all of the given input data. Read more§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere T: Decode,
§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> Hashable for Twhere
T: Codec,
impl<T> Hashable for Twhere T: Codec,
§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>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where F: FnOnce(&Self) -> bool,
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> IsType<T> for T
impl<T> IsType<T> for T
§impl<T> KeyedVec for Twhere
T: Codec,
impl<T> KeyedVec for Twhere T: Codec,
§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) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere Self: Borrow<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> Rwhere Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere Self: AsRef<U>, U: 'a + ?Sized, R: 'a,
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) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere Self: AsMut<U>, U: 'a + ?Sized, R: 'a,
self
, then passes self.as_mut()
into the pipe
function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read more§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,
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)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.