Struct dock_runtime::did::VerRelType
source · pub struct VerRelType { /* private fields */ }
Expand description
Different verification relation types specified in the DID spec here https://www.w3.org/TR/did-core/#verification-relationships.
Implementations§
source§impl VerRelType
impl VerRelType
sourcepub const NONE: VerRelType = Self{ bits: 0,}
pub const NONE: VerRelType = Self{ bits: 0,}
No verification relation set.
sourcepub const AUTHENTICATION: VerRelType = Self{ bits: 1,}
pub const AUTHENTICATION: VerRelType = Self{ bits: 1,}
https://www.w3.org/TR/did-core/#authentication
sourcepub const ASSERTION: VerRelType = Self{ bits: 2,}
pub const ASSERTION: VerRelType = Self{ bits: 2,}
https://www.w3.org/TR/did-core/#assertion
sourcepub const CAPABILITY_INVOCATION: VerRelType = Self{ bits: 4,}
pub const CAPABILITY_INVOCATION: VerRelType = Self{ bits: 4,}
A key must have this to control a DID https://www.w3.org/TR/did-core/#capability-invocation
sourcepub const KEY_AGREEMENT: VerRelType = Self{ bits: 8,}
pub const KEY_AGREEMENT: VerRelType = Self{ bits: 8,}
https://www.w3.org/TR/did-core/#key-agreement
sourcepub const ALL_FOR_SIGNING: VerRelType = Self{ bits: 7,}
pub const ALL_FOR_SIGNING: VerRelType = Self{ bits: 7,}
Includes AUTHENTICATION
, ASSERTION
, CAPABILITY_INVOCATION
.
We might add more relationships in future but these 3 are all we care about now.
sourcepub const fn empty() -> VerRelType
pub const fn empty() -> VerRelType
Returns an empty set of flags.
sourcepub const fn all() -> VerRelType
pub const fn all() -> VerRelType
Returns the set containing all flags.
sourcepub const fn from_bits(bits: u16) -> Option<VerRelType>
pub const fn from_bits(bits: u16) -> Option<VerRelType>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: u16) -> VerRelType
pub const fn from_bits_truncate(bits: u16) -> VerRelType
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u16) -> VerRelType
pub const unsafe fn from_bits_unchecked(bits: u16) -> VerRelType
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Safety
The caller of the bitflags!
macro can chose to allow or
disallow extra bits for their bitflags type.
The caller of from_bits_unchecked()
has to ensure that
all bits correspond to a defined flag or that extra bits
are valid for this bitflags type.
sourcepub const fn intersects(&self, other: VerRelType) -> bool
pub const fn intersects(&self, other: VerRelType) -> bool
Returns true
if there are flags common to both self
and other
.
sourcepub const fn contains(&self, other: VerRelType) -> bool
pub const fn contains(&self, other: VerRelType) -> bool
Returns true
if all of the flags in other
are contained within self
.
sourcepub fn insert(&mut self, other: VerRelType)
pub fn insert(&mut self, other: VerRelType)
Inserts the specified flags in-place.
sourcepub fn remove(&mut self, other: VerRelType)
pub fn remove(&mut self, other: VerRelType)
Removes the specified flags in-place.
sourcepub fn toggle(&mut self, other: VerRelType)
pub fn toggle(&mut self, other: VerRelType)
Toggles the specified flags in-place.
sourcepub fn set(&mut self, other: VerRelType, value: bool)
pub fn set(&mut self, other: VerRelType, value: bool)
Inserts or removes the specified flags depending on the passed value.
sourcepub const fn intersection(self, other: VerRelType) -> VerRelType
pub const fn intersection(self, other: VerRelType) -> VerRelType
Returns the intersection between the flags in self
and
other
.
Specifically, the returned set contains only the flags which are
present in both self
and other
.
This is equivalent to using the &
operator (e.g.
ops::BitAnd
), as in flags & other
.
sourcepub const fn union(self, other: VerRelType) -> VerRelType
pub const fn union(self, other: VerRelType) -> VerRelType
Returns the union of between the flags in self
and other
.
Specifically, the returned set contains all flags which are
present in either self
or other
, including any which are
present in both (see Self::symmetric_difference
if that
is undesirable).
This is equivalent to using the |
operator (e.g.
ops::BitOr
), as in flags | other
.
sourcepub const fn difference(self, other: VerRelType) -> VerRelType
pub const fn difference(self, other: VerRelType) -> VerRelType
Returns the difference between the flags in self
and other
.
Specifically, the returned set contains all flags present in
self
, except for the ones present in other
.
It is also conceptually equivalent to the “bit-clear” operation:
flags & !other
(and this syntax is also supported).
This is equivalent to using the -
operator (e.g.
ops::Sub
), as in flags - other
.
sourcepub const fn symmetric_difference(self, other: VerRelType) -> VerRelType
pub const fn symmetric_difference(self, other: VerRelType) -> VerRelType
Returns the symmetric difference between the flags
in self
and other
.
Specifically, the returned set contains the flags present which
are present in self
or other
, but that are not present in
both. Equivalently, it contains the flags present in exactly
one of the sets self
and other
.
This is equivalent to using the ^
operator (e.g.
ops::BitXor
), as in flags ^ other
.
sourcepub const fn complement(self) -> VerRelType
pub const fn complement(self) -> VerRelType
Returns the complement of this set of flags.
Specifically, the returned set contains all the flags which are
not set in self
, but which are allowed for this type.
Alternatively, it can be thought of as the set difference
between Self::all()
and self
(e.g. Self::all() - self
)
This is equivalent to using the !
operator (e.g.
ops::Not
), as in !flags
.
Trait Implementations§
source§impl Binary for VerRelType
impl Binary for VerRelType
source§impl BitAnd<VerRelType> for VerRelType
impl BitAnd<VerRelType> for VerRelType
source§fn bitand(self, other: VerRelType) -> VerRelType
fn bitand(self, other: VerRelType) -> VerRelType
Returns the intersection between the two sets of flags.
§type Output = VerRelType
type Output = VerRelType
&
operator.source§impl BitAndAssign<VerRelType> for VerRelType
impl BitAndAssign<VerRelType> for VerRelType
source§fn bitand_assign(&mut self, other: VerRelType)
fn bitand_assign(&mut self, other: VerRelType)
Disables all flags disabled in the set.
source§impl BitOr<VerRelType> for VerRelType
impl BitOr<VerRelType> for VerRelType
source§fn bitor(self, other: VerRelType) -> VerRelType
fn bitor(self, other: VerRelType) -> VerRelType
Returns the union of the two sets of flags.
§type Output = VerRelType
type Output = VerRelType
|
operator.source§impl BitOrAssign<VerRelType> for VerRelType
impl BitOrAssign<VerRelType> for VerRelType
source§fn bitor_assign(&mut self, other: VerRelType)
fn bitor_assign(&mut self, other: VerRelType)
Adds the set of flags.
source§impl BitXor<VerRelType> for VerRelType
impl BitXor<VerRelType> for VerRelType
source§fn bitxor(self, other: VerRelType) -> VerRelType
fn bitxor(self, other: VerRelType) -> VerRelType
Returns the left flags, but with all the right flags toggled.
§type Output = VerRelType
type Output = VerRelType
^
operator.source§impl BitXorAssign<VerRelType> for VerRelType
impl BitXorAssign<VerRelType> for VerRelType
source§fn bitxor_assign(&mut self, other: VerRelType)
fn bitxor_assign(&mut self, other: VerRelType)
Toggles the set of flags.
source§impl Clone for VerRelType
impl Clone for VerRelType
source§fn clone(&self) -> VerRelType
fn clone(&self) -> VerRelType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for VerRelType
impl Debug for VerRelType
source§impl Decode for VerRelType
impl Decode for VerRelType
source§fn decode<I>(input: &mut I) -> Result<VerRelType, Error>where
I: Input,
fn decode<I>(input: &mut I) -> Result<VerRelType, Error>where I: Input,
§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<'de> Deserialize<'de> for VerRelType
impl<'de> Deserialize<'de> for VerRelType
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<VerRelType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<VerRelType, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
source§impl Encode for VerRelType
impl Encode for VerRelType
§fn encode_to<T>(&self, dest: &mut T)where
T: Output + ?Sized,
fn encode_to<T>(&self, dest: &mut T)where T: Output + ?Sized,
§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 Extend<VerRelType> for VerRelType
impl Extend<VerRelType> for VerRelType
source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = VerRelType>,
fn extend<T>(&mut self, iterator: T)where T: IntoIterator<Item = VerRelType>,
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)source§impl FromIterator<VerRelType> for VerRelType
impl FromIterator<VerRelType> for VerRelType
source§fn from_iter<T>(iterator: T) -> VerRelTypewhere
T: IntoIterator<Item = VerRelType>,
fn from_iter<T>(iterator: T) -> VerRelTypewhere T: IntoIterator<Item = VerRelType>,
source§impl Hash for VerRelType
impl Hash for VerRelType
source§impl LowerHex for VerRelType
impl LowerHex for VerRelType
source§impl MaxEncodedLen for VerRelType
impl MaxEncodedLen for VerRelType
source§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
source§impl Not for VerRelType
impl Not for VerRelType
source§fn not(self) -> VerRelType
fn not(self) -> VerRelType
Returns the complement of this set of flags.
§type Output = VerRelType
type Output = VerRelType
!
operator.source§impl Octal for VerRelType
impl Octal for VerRelType
source§impl Ord for VerRelType
impl Ord for VerRelType
source§fn cmp(&self, other: &VerRelType) -> Ordering
fn cmp(&self, other: &VerRelType) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<VerRelType> for VerRelType
impl PartialEq<VerRelType> for VerRelType
source§fn eq(&self, other: &VerRelType) -> bool
fn eq(&self, other: &VerRelType) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<VerRelType> for VerRelType
impl PartialOrd<VerRelType> for VerRelType
source§fn partial_cmp(&self, other: &VerRelType) -> Option<Ordering>
fn partial_cmp(&self, other: &VerRelType) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for VerRelType
impl Serialize for VerRelType
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,
source§impl Sub<VerRelType> for VerRelType
impl Sub<VerRelType> for VerRelType
source§fn sub(self, other: VerRelType) -> VerRelType
fn sub(self, other: VerRelType) -> VerRelType
Returns the set difference of the two sets of flags.
§type Output = VerRelType
type Output = VerRelType
-
operator.source§impl SubAssign<VerRelType> for VerRelType
impl SubAssign<VerRelType> for VerRelType
source§fn sub_assign(&mut self, other: VerRelType)
fn sub_assign(&mut self, other: VerRelType)
Disables all flags enabled in the set.
source§impl TryFrom<u16> for VerRelType
impl TryFrom<u16> for VerRelType
source§impl TypeInfo for VerRelType
impl TypeInfo for VerRelType
source§impl UpperHex for VerRelType
impl UpperHex for VerRelType
impl Copy for VerRelType
impl Eq for VerRelType
impl StructuralEq for VerRelType
impl StructuralPartialEq for VerRelType
Auto Trait Implementations§
impl RefUnwindSafe for VerRelType
impl Send for VerRelType
impl Sync for VerRelType
impl Unpin for VerRelType
impl UnwindSafe for VerRelType
Blanket Implementations§
source§impl<T> CanUpdate<()> for T
impl<T> CanUpdate<()> for T
source§fn can_remove(&self, _entity: &()) -> bool
fn can_remove(&self, _entity: &()) -> bool
§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> 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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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>
§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> 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<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
.