pub struct RefTypes {
pub(crate) bits: u32,
}
Fields§
§bits: u32
Implementations§
§impl RefTypes
impl RefTypes
pub const NORMAL: RefTypes = _
pub const DIRECT_ACCESS: RefTypes = _
pub const fn from_bits(bits: u32) -> Option<RefTypes>
pub const fn from_bits(bits: u32) -> Option<RefTypes>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
pub const fn from_bits_truncate(bits: u32) -> RefTypes
pub const fn from_bits_truncate(bits: u32) -> RefTypes
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
pub const unsafe fn from_bits_unchecked(bits: u32) -> RefTypes
pub const unsafe fn from_bits_unchecked(bits: u32) -> RefTypes
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.
pub const fn intersects(&self, other: RefTypes) -> bool
pub const fn intersects(&self, other: RefTypes) -> bool
Returns true
if there are flags common to both self
and other
.
pub const fn contains(&self, other: RefTypes) -> bool
pub const fn contains(&self, other: RefTypes) -> bool
Returns true
if all of the flags in other
are contained within self
.
pub fn set(&mut self, other: RefTypes, value: bool)
pub fn set(&mut self, other: RefTypes, value: bool)
Inserts or removes the specified flags depending on the passed value.
pub const fn intersection(self, other: RefTypes) -> RefTypes
pub const fn intersection(self, other: RefTypes) -> RefTypes
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
.
pub const fn union(self, other: RefTypes) -> RefTypes
pub const fn union(self, other: RefTypes) -> RefTypes
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
.
pub const fn difference(self, other: RefTypes) -> RefTypes
pub const fn difference(self, other: RefTypes) -> RefTypes
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
.
pub const fn symmetric_difference(self, other: RefTypes) -> RefTypes
pub const fn symmetric_difference(self, other: RefTypes) -> RefTypes
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
.
pub const fn complement(self) -> RefTypes
pub const fn complement(self) -> RefTypes
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§
§impl BitAndAssign for RefTypes
impl BitAndAssign for RefTypes
§fn bitand_assign(&mut self, other: RefTypes)
fn bitand_assign(&mut self, other: RefTypes)
Disables all flags disabled in the set.
§impl BitOrAssign for RefTypes
impl BitOrAssign for RefTypes
§fn bitor_assign(&mut self, other: RefTypes)
fn bitor_assign(&mut self, other: RefTypes)
Adds the set of flags.
§impl BitXorAssign for RefTypes
impl BitXorAssign for RefTypes
§fn bitxor_assign(&mut self, other: RefTypes)
fn bitxor_assign(&mut self, other: RefTypes)
Toggles the set of flags.
§impl<X> Categorize<X> for RefTypeswhere
X: CustomValueKind,
impl<X> Categorize<X> for RefTypeswhere
X: CustomValueKind,
fn value_kind() -> ValueKind<X>
§impl<D, X> Decode<X, D> for RefTypeswhere
D: Decoder<X>,
X: CustomValueKind,
impl<D, X> Decode<X, D> for RefTypeswhere
D: Decoder<X>,
X: CustomValueKind,
§fn decode_body_with_value_kind(
decoder: &mut D,
value_kind: ValueKind<X>
) -> Result<RefTypes, DecodeError>
fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<X> ) -> Result<RefTypes, DecodeError>
§impl<C> Describe<C> for RefTypeswhere
C: CustomTypeKind<RustTypeId>,
impl<C> Describe<C> for RefTypeswhere
C: CustomTypeKind<RustTypeId>,
§const TYPE_ID: RustTypeId = _
const TYPE_ID: RustTypeId = _
TYPE_ID
should give a unique identifier for its SBOR schema type.
An SBOR schema type capture details about the SBOR payload, how it should be interpreted, validated and displayed. Read more§fn type_data() -> TypeData<C, RustTypeId>
fn type_data() -> TypeData<C, RustTypeId>
§fn add_all_dependencies(aggregator: &mut TypeAggregator<C>)
fn add_all_dependencies(aggregator: &mut TypeAggregator<C>)
get_local_type_data
, we need to ensure that the type and all of its own references
get added to the aggregator. Read more§impl<E, X> Encode<X, E> for RefTypeswhere
E: Encoder<X>,
X: CustomValueKind,
impl<E, X> Encode<X, E> for RefTypeswhere
E: Encoder<X>,
X: CustomValueKind,
§fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
§fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
§impl Extend<RefTypes> for RefTypes
impl Extend<RefTypes> for RefTypes
§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = RefTypes>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = RefTypes>,
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
)§impl FromIterator<RefTypes> for RefTypes
impl FromIterator<RefTypes> for RefTypes
§impl Ord for RefTypes
impl Ord for RefTypes
§impl PartialOrd for RefTypes
impl PartialOrd for RefTypes
§fn partial_cmp(&self, other: &RefTypes) -> Option<Ordering>
fn partial_cmp(&self, other: &RefTypes) -> 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 more§impl<X> SborTuple<X> for RefTypeswhere
X: CustomValueKind,
impl<X> SborTuple<X> for RefTypeswhere
X: CustomValueKind,
fn get_length(&self) -> usize
§impl SubAssign for RefTypes
impl SubAssign for RefTypes
§fn sub_assign(&mut self, other: RefTypes)
fn sub_assign(&mut self, other: RefTypes)
Disables all flags enabled in the set.
impl Copy for RefTypes
impl Eq for RefTypes
impl StructuralPartialEq for RefTypes
Auto Trait Implementations§
impl RefUnwindSafe for RefTypes
impl Send for RefTypes
impl Sync for RefTypes
impl Unpin for RefTypes
impl UnwindSafe for RefTypes
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 moresource§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<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.