Struct rive::prelude::server::ServerFlags
source · pub struct ServerFlags(_);Expand description
Server flag enum
Implementations§
source§impl ServerFlags
impl ServerFlags
pub const Verified: ServerFlags = Self::from_bits_retain(1)
pub const Official: ServerFlags = Self::from_bits_retain(2)
source§impl ServerFlags
impl ServerFlags
sourcepub const fn empty() -> ServerFlags
pub const fn empty() -> ServerFlags
Get a flags value with all bits unset.
sourcepub const fn all() -> ServerFlags
pub const fn all() -> ServerFlags
Get a flags value with all known bits set.
sourcepub const fn bits(&self) -> u64
pub const fn bits(&self) -> u64
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
sourcepub const fn from_bits(bits: u64) -> Option<ServerFlags>
pub const fn from_bits(bits: u64) -> Option<ServerFlags>
Convert from a bits value.
This method will return None if any unknown bits are set.
sourcepub const fn from_bits_truncate(bits: u64) -> ServerFlags
pub const fn from_bits_truncate(bits: u64) -> ServerFlags
Convert from a bits value, unsetting any unknown bits.
sourcepub const fn from_bits_retain(bits: u64) -> ServerFlags
pub const fn from_bits_retain(bits: u64) -> ServerFlags
Convert from a bits value exactly.
sourcepub fn from_name(name: &str) -> Option<ServerFlags>
pub fn from_name(name: &str) -> Option<ServerFlags>
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: ServerFlags) -> bool
pub const fn intersects(&self, other: ServerFlags) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
sourcepub const fn contains(&self, other: ServerFlags) -> bool
pub const fn contains(&self, other: ServerFlags) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
sourcepub fn insert(&mut self, other: ServerFlags)
pub fn insert(&mut self, other: ServerFlags)
The bitwise or (|) of the bits in two flags values.
sourcepub fn remove(&mut self, other: ServerFlags)
pub fn remove(&mut self, other: ServerFlags)
The intersection of a source flags value with the complement of a target flags value (&!).
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: ServerFlags)
pub fn toggle(&mut self, other: ServerFlags)
The bitwise exclusive-or (^) of the bits in two flags values.
sourcepub fn set(&mut self, other: ServerFlags, value: bool)
pub fn set(&mut self, other: ServerFlags, value: bool)
Call insert when value is true or remove when value is false.
sourcepub const fn intersection(self, other: ServerFlags) -> ServerFlags
pub const fn intersection(self, other: ServerFlags) -> ServerFlags
The bitwise and (&) of the bits in two flags values.
sourcepub const fn union(self, other: ServerFlags) -> ServerFlags
pub const fn union(self, other: ServerFlags) -> ServerFlags
The bitwise or (|) of the bits in two flags values.
sourcepub const fn difference(self, other: ServerFlags) -> ServerFlags
pub const fn difference(self, other: ServerFlags) -> ServerFlags
The intersection of a source flags value with the complement of a target flags value (&!).
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: ServerFlags) -> ServerFlags
pub const fn symmetric_difference(self, other: ServerFlags) -> ServerFlags
The bitwise exclusive-or (^) of the bits in two flags values.
sourcepub const fn complement(self) -> ServerFlags
pub const fn complement(self) -> ServerFlags
The bitwise negation (!) of the bits in a flags value, truncating the result.
source§impl ServerFlags
impl ServerFlags
sourcepub const fn iter(&self) -> Iter<ServerFlags>
pub const fn iter(&self) -> Iter<ServerFlags>
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<ServerFlags>
pub const fn iter_names(&self) -> IterNames<ServerFlags>
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 ServerFlags
impl Binary for ServerFlags
source§impl BitAnd<ServerFlags> for ServerFlags
impl BitAnd<ServerFlags> for ServerFlags
source§fn bitand(self, other: ServerFlags) -> ServerFlags
fn bitand(self, other: ServerFlags) -> ServerFlags
The bitwise and (&) of the bits in two flags values.
§type Output = ServerFlags
type Output = ServerFlags
& operator.source§impl BitAndAssign<ServerFlags> for ServerFlags
impl BitAndAssign<ServerFlags> for ServerFlags
source§fn bitand_assign(&mut self, other: ServerFlags)
fn bitand_assign(&mut self, other: ServerFlags)
The bitwise and (&) of the bits in two flags values.
source§impl BitOr<ServerFlags> for ServerFlags
impl BitOr<ServerFlags> for ServerFlags
source§fn bitor(self, other: ServerFlags) -> ServerFlags
fn bitor(self, other: ServerFlags) -> ServerFlags
The bitwise or (|) of the bits in two flags values.
§type Output = ServerFlags
type Output = ServerFlags
| operator.source§impl BitOrAssign<ServerFlags> for ServerFlags
impl BitOrAssign<ServerFlags> for ServerFlags
source§fn bitor_assign(&mut self, other: ServerFlags)
fn bitor_assign(&mut self, other: ServerFlags)
The bitwise or (|) of the bits in two flags values.
source§impl BitXor<ServerFlags> for ServerFlags
impl BitXor<ServerFlags> for ServerFlags
source§fn bitxor(self, other: ServerFlags) -> ServerFlags
fn bitxor(self, other: ServerFlags) -> ServerFlags
The bitwise exclusive-or (^) of the bits in two flags values.
§type Output = ServerFlags
type Output = ServerFlags
^ operator.source§impl BitXorAssign<ServerFlags> for ServerFlags
impl BitXorAssign<ServerFlags> for ServerFlags
source§fn bitxor_assign(&mut self, other: ServerFlags)
fn bitxor_assign(&mut self, other: ServerFlags)
The bitwise exclusive-or (^) of the bits in two flags values.
source§impl Clone for ServerFlags
impl Clone for ServerFlags
source§fn clone(&self) -> ServerFlags
fn clone(&self) -> ServerFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ServerFlags
impl Debug for ServerFlags
source§impl<'de> Deserialize<'de> for ServerFlags
impl<'de> Deserialize<'de> for ServerFlags
source§fn deserialize<D>(
deserializer: D
) -> Result<ServerFlags, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>( deserializer: D ) -> Result<ServerFlags, <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,
source§impl Extend<ServerFlags> for ServerFlags
impl Extend<ServerFlags> for ServerFlags
source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ServerFlags>,
fn extend<T>(&mut self, iterator: T)where T: IntoIterator<Item = ServerFlags>,
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 ServerFlags
impl Flags for ServerFlags
source§const FLAGS: &'static [Flag<ServerFlags>] = &[{ ::bitflags::Flag::new("Verified", ServerFlags::Verified) },
{ ::bitflags::Flag::new("Official", ServerFlags::Official) }]
const FLAGS: &'static [Flag<ServerFlags>] = &[{ ::bitflags::Flag::new("Verified", ServerFlags::Verified) }, { ::bitflags::Flag::new("Official", ServerFlags::Official) }]
source§fn from_bits_retain(bits: u64) -> ServerFlags
fn from_bits_retain(bits: u64) -> ServerFlags
§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 intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere Self: Sized,
§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere Self: Sized,
§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where Self: Sized,
|) of the bits in two flags values.§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where Self: Sized,
&!). Read more§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where Self: Sized,
^) of the bits in two flags values.§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 two flags values.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!). Read more§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^) of the bits in two flags values.§fn complement(self) -> Self
fn complement(self) -> Self
!) of the bits in a flags value, truncating the result.source§impl FromIterator<ServerFlags> for ServerFlags
impl FromIterator<ServerFlags> for ServerFlags
source§fn from_iter<T>(iterator: T) -> ServerFlagswhere
T: IntoIterator<Item = ServerFlags>,
fn from_iter<T>(iterator: T) -> ServerFlagswhere T: IntoIterator<Item = ServerFlags>,
The bitwise or (|) of the bits in each flags value.
source§impl Hash for ServerFlags
impl Hash for ServerFlags
source§impl IntoIterator for ServerFlags
impl IntoIterator for ServerFlags
§type Item = ServerFlags
type Item = ServerFlags
§type IntoIter = Iter<ServerFlags>
type IntoIter = Iter<ServerFlags>
source§fn into_iter(self) -> <ServerFlags as IntoIterator>::IntoIter
fn into_iter(self) -> <ServerFlags as IntoIterator>::IntoIter
source§impl LowerHex for ServerFlags
impl LowerHex for ServerFlags
source§impl Not for ServerFlags
impl Not for ServerFlags
source§fn not(self) -> ServerFlags
fn not(self) -> ServerFlags
The bitwise negation (!) of the bits in a flags value, truncating the result.
§type Output = ServerFlags
type Output = ServerFlags
! operator.source§impl Octal for ServerFlags
impl Octal for ServerFlags
source§impl Ord for ServerFlags
impl Ord for ServerFlags
source§fn cmp(&self, other: &ServerFlags) -> Ordering
fn cmp(&self, other: &ServerFlags) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<ServerFlags> for ServerFlags
impl PartialEq<ServerFlags> for ServerFlags
source§fn eq(&self, other: &ServerFlags) -> bool
fn eq(&self, other: &ServerFlags) -> bool
self and other values to be equal, and is used
by ==.source§impl PartialOrd<ServerFlags> for ServerFlags
impl PartialOrd<ServerFlags> for ServerFlags
source§fn partial_cmp(&self, other: &ServerFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &ServerFlags) -> 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 ServerFlags
impl Serialize for ServerFlags
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<ServerFlags> for ServerFlags
impl Sub<ServerFlags> for ServerFlags
source§fn sub(self, other: ServerFlags) -> ServerFlags
fn sub(self, other: ServerFlags) -> ServerFlags
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
§type Output = ServerFlags
type Output = ServerFlags
- operator.source§impl SubAssign<ServerFlags> for ServerFlags
impl SubAssign<ServerFlags> for ServerFlags
source§fn sub_assign(&mut self, other: ServerFlags)
fn sub_assign(&mut self, other: ServerFlags)
The intersection of a source flags value with the complement of a target flags value (&!).
This method is not equivalent to self & !other when other has unknown bits set.
difference won’t truncate other, but the ! operator will.
source§impl UpperHex for ServerFlags
impl UpperHex for ServerFlags
impl Copy for ServerFlags
impl Eq for ServerFlags
impl StructuralEq for ServerFlags
impl StructuralPartialEq for ServerFlags
Auto Trait Implementations§
impl RefUnwindSafe for ServerFlags
impl Send for ServerFlags
impl Sync for ServerFlags
impl Unpin for ServerFlags
impl UnwindSafe for ServerFlags
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<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.