pub(in worldgen::feature) struct UpdateFlags(u16);Expand description
Flags that control how a block update is processed.
Tuple Fields§
§0: u16Implementations§
Source§impl UpdateFlags
impl UpdateFlags
pub const UPDATE_NEIGHBORS: UpdateFlags
pub const UPDATE_CLIENTS: UpdateFlags
pub const UPDATE_INVISIBLE: UpdateFlags
pub const UPDATE_IMMEDIATE: UpdateFlags
pub const UPDATE_KNOWN_SHAPE: UpdateFlags
pub const UPDATE_SUPPRESS_DROPS: UpdateFlags
pub const UPDATE_MOVE_BY_PISTON: UpdateFlags
pub const UPDATE_SKIP_SHAPE_UPDATE_ON_WIRE: UpdateFlags
pub const UPDATE_SKIP_BLOCK_ENTITY_SIDEEFFECTS: UpdateFlags
pub const UPDATE_SKIP_ON_PLACE: UpdateFlags
pub const UPDATE_NONE: UpdateFlags
pub const UPDATE_ALL: UpdateFlags
pub const UPDATE_ALL_IMMEDIATE: UpdateFlags
Source§impl UpdateFlags
impl UpdateFlags
Sourcepub const fn empty() -> UpdateFlags
pub const fn empty() -> UpdateFlags
Get a flags value with all bits unset.
Sourcepub const fn all() -> UpdateFlags
pub const fn all() -> UpdateFlags
Get a flags value with all known bits set.
Sourcepub const fn bits(&self) -> u16
pub const fn bits(&self) -> u16
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u16) -> Option<UpdateFlags>
pub const fn from_bits(bits: u16) -> Option<UpdateFlags>
Convert from a bits value.
This method will return None if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u16) -> UpdateFlags
pub const fn from_bits_truncate(bits: u16) -> UpdateFlags
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u16) -> UpdateFlags
pub const fn from_bits_retain(bits: u16) -> UpdateFlags
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<UpdateFlags>
pub fn from_name(name: &str) -> Option<UpdateFlags>
Get a flags value with the bits of a flag with the given name set.
This method will return None if name is empty or doesn’t
correspond to any named flag.
Sourcepub const fn intersects(&self, other: UpdateFlags) -> bool
pub const fn intersects(&self, other: UpdateFlags) -> bool
Whether any set bits in other are also set in self.
Sourcepub const fn contains(&self, other: UpdateFlags) -> bool
pub const fn contains(&self, other: UpdateFlags) -> bool
Whether all set bits in other are also set in self.
Sourcepub fn insert(&mut self, other: UpdateFlags)
pub fn insert(&mut self, other: UpdateFlags)
The bitwise or (|) of the bits in self and other.
Sourcepub fn remove(&mut self, other: UpdateFlags)
pub fn remove(&mut self, other: UpdateFlags)
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
remove won’t truncate other, but the ! operator will.
Sourcepub fn toggle(&mut self, other: UpdateFlags)
pub fn toggle(&mut self, other: UpdateFlags)
The bitwise exclusive-or (^) of the bits in self and other.
Sourcepub fn set(&mut self, other: UpdateFlags, value: bool)
pub fn set(&mut self, other: UpdateFlags, value: bool)
Call insert when value is true or remove when value is false.
Sourcepub const fn intersection(self, other: UpdateFlags) -> UpdateFlags
pub const fn intersection(self, other: UpdateFlags) -> UpdateFlags
The bitwise and (&) of the bits in self and other.
Sourcepub const fn union(self, other: UpdateFlags) -> UpdateFlags
pub const fn union(self, other: UpdateFlags) -> UpdateFlags
The bitwise or (|) of the bits in self and other.
Sourcepub const fn difference(self, other: UpdateFlags) -> UpdateFlags
pub const fn difference(self, other: UpdateFlags) -> UpdateFlags
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Sourcepub const fn symmetric_difference(self, other: UpdateFlags) -> UpdateFlags
pub const fn symmetric_difference(self, other: UpdateFlags) -> UpdateFlags
The bitwise exclusive-or (^) of the bits in self and other.
Sourcepub const fn complement(self) -> UpdateFlags
pub const fn complement(self) -> UpdateFlags
The bitwise negation (!) of the bits in self, truncating the result.
Source§impl UpdateFlags
impl UpdateFlags
Sourcepub const fn iter(&self) -> Iter<UpdateFlags> ⓘ
pub const fn iter(&self) -> Iter<UpdateFlags> ⓘ
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub const fn iter_names(&self) -> IterNames<UpdateFlags> ⓘ
pub const fn iter_names(&self) -> IterNames<UpdateFlags> ⓘ
Yield a set of contained named flags values.
This method is like iter, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait Implementations§
Source§impl Binary for UpdateFlags
impl Binary for UpdateFlags
Source§impl BitAnd for UpdateFlags
impl BitAnd for UpdateFlags
Source§fn bitand(self, other: UpdateFlags) -> UpdateFlags
fn bitand(self, other: UpdateFlags) -> UpdateFlags
The bitwise and (&) of the bits in self and other.
Source§type Output = UpdateFlags
type Output = UpdateFlags
& operator.Source§impl BitAndAssign for UpdateFlags
impl BitAndAssign for UpdateFlags
Source§fn bitand_assign(&mut self, other: UpdateFlags)
fn bitand_assign(&mut self, other: UpdateFlags)
The bitwise and (&) of the bits in self and other.
Source§impl BitOr for UpdateFlags
impl BitOr for UpdateFlags
Source§fn bitor(self, other: UpdateFlags) -> UpdateFlags
fn bitor(self, other: UpdateFlags) -> UpdateFlags
The bitwise or (|) of the bits in self and other.
Source§type Output = UpdateFlags
type Output = UpdateFlags
| operator.Source§impl BitOrAssign for UpdateFlags
impl BitOrAssign for UpdateFlags
Source§fn bitor_assign(&mut self, other: UpdateFlags)
fn bitor_assign(&mut self, other: UpdateFlags)
The bitwise or (|) of the bits in self and other.
Source§impl BitXor for UpdateFlags
impl BitXor for UpdateFlags
Source§fn bitxor(self, other: UpdateFlags) -> UpdateFlags
fn bitxor(self, other: UpdateFlags) -> UpdateFlags
The bitwise exclusive-or (^) of the bits in self and other.
Source§type Output = UpdateFlags
type Output = UpdateFlags
^ operator.Source§impl BitXorAssign for UpdateFlags
impl BitXorAssign for UpdateFlags
Source§fn bitxor_assign(&mut self, other: UpdateFlags)
fn bitxor_assign(&mut self, other: UpdateFlags)
The bitwise exclusive-or (^) of the bits in self and other.
Source§impl Clone for UpdateFlags
impl Clone for UpdateFlags
Source§fn clone(&self) -> UpdateFlags
fn clone(&self) -> UpdateFlags
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for UpdateFlags
Source§impl Debug for UpdateFlags
impl Debug for UpdateFlags
impl Eq for UpdateFlags
Source§impl Extend<UpdateFlags> for UpdateFlags
impl Extend<UpdateFlags> for UpdateFlags
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = UpdateFlags>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = UpdateFlags>,
The bitwise or (|) of the bits in each flags value.
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 Flags for UpdateFlags
impl Flags for UpdateFlags
Source§const FLAGS: &'static [Flag<UpdateFlags>]
const FLAGS: &'static [Flag<UpdateFlags>]
Source§fn from_bits_retain(bits: u16) -> UpdateFlags
fn from_bits_retain(bits: u16) -> UpdateFlags
Source§fn all_named() -> UpdateFlags
fn all_named() -> UpdateFlags
§fn known_bits(&self) -> Self::Bits
fn known_bits(&self) -> Self::Bits
§fn unknown_bits(&self) -> Self::Bits
fn unknown_bits(&self) -> Self::Bits
§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true if any unknown bits are set.§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
§fn iter_names(&self) -> IterNames<Self> ⓘ
fn iter_names(&self) -> IterNames<Self> ⓘ
§fn iter_defined_names() -> IterDefinedNames<Self> ⓘ
fn iter_defined_names() -> IterDefinedNames<Self> ⓘ
Self::FLAGS].§fn iter_equal_names(&self) -> IterEqualNames<Self> ⓘ
fn iter_equal_names(&self) -> IterEqualNames<Self> ⓘ
§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
other are also set in self.§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|) of the bits in self and other.§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^) of the bits in self and other.§fn set(&mut self, other: Self, value: bool)where
Self: Sized,
fn set(&mut self, other: Self, value: bool)where
Self: Sized,
Flags::insert] when value is true or [Flags::remove] when value is false.§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&) of the bits in self and other.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in self and other.§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in self, truncating the result.Source§impl FromIterator<UpdateFlags> for UpdateFlags
impl FromIterator<UpdateFlags> for UpdateFlags
Source§fn from_iter<T>(iterator: T) -> UpdateFlagswhere
T: IntoIterator<Item = UpdateFlags>,
fn from_iter<T>(iterator: T) -> UpdateFlagswhere
T: IntoIterator<Item = UpdateFlags>,
The bitwise or (|) of the bits in each flags value.
Source§impl IntoIterator for UpdateFlags
impl IntoIterator for UpdateFlags
Source§type Item = UpdateFlags
type Item = UpdateFlags
Source§type IntoIter = Iter<UpdateFlags>
type IntoIter = Iter<UpdateFlags>
Source§fn into_iter(self) -> <UpdateFlags as IntoIterator>::IntoIter
fn into_iter(self) -> <UpdateFlags as IntoIterator>::IntoIter
Source§impl LowerHex for UpdateFlags
impl LowerHex for UpdateFlags
Source§impl Not for UpdateFlags
impl Not for UpdateFlags
Source§fn not(self) -> UpdateFlags
fn not(self) -> UpdateFlags
The bitwise negation (!) of the bits in self, truncating the result.
Source§type Output = UpdateFlags
type Output = UpdateFlags
! operator.Source§impl Octal for UpdateFlags
impl Octal for UpdateFlags
Source§impl PartialEq for UpdateFlags
impl PartialEq for UpdateFlags
impl StructuralPartialEq for UpdateFlags
Source§impl Sub for UpdateFlags
impl Sub for UpdateFlags
Source§fn sub(self, other: UpdateFlags) -> UpdateFlags
fn sub(self, other: UpdateFlags) -> UpdateFlags
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Source§type Output = UpdateFlags
type Output = UpdateFlags
- operator.Source§impl SubAssign for UpdateFlags
impl SubAssign for UpdateFlags
Source§fn sub_assign(&mut self, other: UpdateFlags)
fn sub_assign(&mut self, other: UpdateFlags)
The intersection of self with the complement of other (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
Auto Trait Implementations§
impl Freeze for UpdateFlags
impl RefUnwindSafe for UpdateFlags
impl Send for UpdateFlags
impl Sync for UpdateFlags
impl Unpin for UpdateFlags
impl UnsafeUnpin for UpdateFlags
impl UnwindSafe for UpdateFlags
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
self with key and returns true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreArc<SyncMutex<>>