Struct spacetimedb_sats::db::attr::ColumnAttribute
source · pub struct ColumnAttribute(/* private fields */);
Implementations§
source§impl ColumnAttribute
impl ColumnAttribute
pub const UNSET: ColumnAttribute = _
sourcepub const INDEXED: ColumnAttribute = _
pub const INDEXED: ColumnAttribute = _
Index no unique
sourcepub const AUTO_INC: ColumnAttribute = _
pub const AUTO_INC: ColumnAttribute = _
Generate the next [Sequence]
sourcepub const UNIQUE: ColumnAttribute = _
pub const UNIQUE: ColumnAttribute = _
Index unique
sourcepub const IDENTITY: ColumnAttribute = _
pub const IDENTITY: ColumnAttribute = _
Unique + AutoInc
sourcepub const PRIMARY_KEY: ColumnAttribute = _
pub const PRIMARY_KEY: ColumnAttribute = _
Primary key column (implies Unique)
sourcepub const PRIMARY_KEY_AUTO: ColumnAttribute = _
pub const PRIMARY_KEY_AUTO: ColumnAttribute = _
PrimaryKey + AutoInc
sourcepub const PRIMARY_KEY_IDENTITY: ColumnAttribute = _
pub const PRIMARY_KEY_IDENTITY: ColumnAttribute = _
PrimaryKey + Identity
source§impl ColumnAttribute
impl ColumnAttribute
sourcepub const fn empty() -> ColumnAttribute
pub const fn empty() -> ColumnAttribute
Get a flags value with all bits unset.
sourcepub const fn all() -> ColumnAttribute
pub const fn all() -> ColumnAttribute
Get a flags value with all known bits set.
sourcepub const fn bits(&self) -> u8
pub const fn bits(&self) -> u8
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
sourcepub const fn from_bits(bits: u8) -> Option<ColumnAttribute>
pub const fn from_bits(bits: u8) -> Option<ColumnAttribute>
Convert from a bits value.
This method will return None
if any unknown bits are set.
sourcepub const fn from_bits_truncate(bits: u8) -> ColumnAttribute
pub const fn from_bits_truncate(bits: u8) -> ColumnAttribute
Convert from a bits value, unsetting any unknown bits.
sourcepub const fn from_bits_retain(bits: u8) -> ColumnAttribute
pub const fn from_bits_retain(bits: u8) -> ColumnAttribute
Convert from a bits value exactly.
sourcepub fn from_name(name: &str) -> Option<ColumnAttribute>
pub fn from_name(name: &str) -> Option<ColumnAttribute>
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: ColumnAttribute) -> bool
pub const fn intersects(&self, other: ColumnAttribute) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
sourcepub const fn contains(&self, other: ColumnAttribute) -> bool
pub const fn contains(&self, other: ColumnAttribute) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
sourcepub fn insert(&mut self, other: ColumnAttribute)
pub fn insert(&mut self, other: ColumnAttribute)
The bitwise or (|
) of the bits in two flags values.
sourcepub fn remove(&mut self, other: ColumnAttribute)
pub fn remove(&mut self, other: ColumnAttribute)
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: ColumnAttribute)
pub fn toggle(&mut self, other: ColumnAttribute)
The bitwise exclusive-or (^
) of the bits in two flags values.
sourcepub fn set(&mut self, other: ColumnAttribute, value: bool)
pub fn set(&mut self, other: ColumnAttribute, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
sourcepub const fn intersection(self, other: ColumnAttribute) -> ColumnAttribute
pub const fn intersection(self, other: ColumnAttribute) -> ColumnAttribute
The bitwise and (&
) of the bits in two flags values.
sourcepub const fn union(self, other: ColumnAttribute) -> ColumnAttribute
pub const fn union(self, other: ColumnAttribute) -> ColumnAttribute
The bitwise or (|
) of the bits in two flags values.
sourcepub const fn difference(self, other: ColumnAttribute) -> ColumnAttribute
pub const fn difference(self, other: ColumnAttribute) -> ColumnAttribute
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: ColumnAttribute
) -> ColumnAttribute
pub const fn symmetric_difference( self, other: ColumnAttribute ) -> ColumnAttribute
The bitwise exclusive-or (^
) of the bits in two flags values.
sourcepub const fn complement(self) -> ColumnAttribute
pub const fn complement(self) -> ColumnAttribute
The bitwise negation (!
) of the bits in a flags value, truncating the result.
source§impl ColumnAttribute
impl ColumnAttribute
sourcepub const fn iter(&self) -> Iter<ColumnAttribute>
pub const fn iter(&self) -> Iter<ColumnAttribute>
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<ColumnAttribute>
pub const fn iter_names(&self) -> IterNames<ColumnAttribute>
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.
source§impl ColumnAttribute
impl ColumnAttribute
sourcepub const fn has_autoinc(&self) -> bool
pub const fn has_autoinc(&self) -> bool
Checks if either ‘IDENTITY’ or ‘PRIMARY_KEY_AUTO’ constraints are set because the imply the use of auto increment sequence.
sourcepub const fn has_unique(&self) -> bool
pub const fn has_unique(&self) -> bool
Checks if the ‘UNIQUE’ constraint is set.
sourcepub const fn has_indexed(&self) -> bool
pub const fn has_indexed(&self) -> bool
Checks if the ‘INDEXED’ constraint is set.
sourcepub const fn has_primary_key(&self) -> bool
pub const fn has_primary_key(&self) -> bool
Checks if the ‘PRIMARY_KEY’ constraint is set.
sourcepub fn kind(&self) -> AttributeKind
pub fn kind(&self) -> AttributeKind
Returns the ColumnAttribute of constraints as an enum variant.
NOTE: This represent the higher possible representation of a constraints, so for example
IDENTITY
imply that is INDEXED, UNIQUE
Trait Implementations§
source§impl Binary for ColumnAttribute
impl Binary for ColumnAttribute
source§impl BitAnd for ColumnAttribute
impl BitAnd for ColumnAttribute
source§fn bitand(self, other: ColumnAttribute) -> ColumnAttribute
fn bitand(self, other: ColumnAttribute) -> ColumnAttribute
The bitwise and (&
) of the bits in two flags values.
§type Output = ColumnAttribute
type Output = ColumnAttribute
&
operator.source§impl BitAndAssign for ColumnAttribute
impl BitAndAssign for ColumnAttribute
source§fn bitand_assign(&mut self, other: ColumnAttribute)
fn bitand_assign(&mut self, other: ColumnAttribute)
The bitwise and (&
) of the bits in two flags values.
source§impl BitOr for ColumnAttribute
impl BitOr for ColumnAttribute
source§fn bitor(self, other: ColumnAttribute) -> ColumnAttribute
fn bitor(self, other: ColumnAttribute) -> ColumnAttribute
The bitwise or (|
) of the bits in two flags values.
§type Output = ColumnAttribute
type Output = ColumnAttribute
|
operator.source§impl BitOrAssign for ColumnAttribute
impl BitOrAssign for ColumnAttribute
source§fn bitor_assign(&mut self, other: ColumnAttribute)
fn bitor_assign(&mut self, other: ColumnAttribute)
The bitwise or (|
) of the bits in two flags values.
source§impl BitXor for ColumnAttribute
impl BitXor for ColumnAttribute
source§fn bitxor(self, other: ColumnAttribute) -> ColumnAttribute
fn bitxor(self, other: ColumnAttribute) -> ColumnAttribute
The bitwise exclusive-or (^
) of the bits in two flags values.
§type Output = ColumnAttribute
type Output = ColumnAttribute
^
operator.source§impl BitXorAssign for ColumnAttribute
impl BitXorAssign for ColumnAttribute
source§fn bitxor_assign(&mut self, other: ColumnAttribute)
fn bitxor_assign(&mut self, other: ColumnAttribute)
The bitwise exclusive-or (^
) of the bits in two flags values.
source§impl Clone for ColumnAttribute
impl Clone for ColumnAttribute
source§fn clone(&self) -> ColumnAttribute
fn clone(&self) -> ColumnAttribute
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ColumnAttribute
impl Debug for ColumnAttribute
source§impl<'de> Deserialize<'de> for ColumnAttribute
impl<'de> Deserialize<'de> for ColumnAttribute
source§fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
deserializer
.source§impl Extend<ColumnAttribute> for ColumnAttribute
impl Extend<ColumnAttribute> for ColumnAttribute
source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ColumnAttribute>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ColumnAttribute>,
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 ColumnAttribute
impl Flags for ColumnAttribute
source§const FLAGS: &'static [Flag<ColumnAttribute>] = _
const FLAGS: &'static [Flag<ColumnAttribute>] = _
source§fn from_bits_retain(bits: u8) -> ColumnAttribute
fn from_bits_retain(bits: u8) -> ColumnAttribute
source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
source§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
source§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.source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read moresource§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.source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read moresource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.source§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.source§impl FromIterator<ColumnAttribute> for ColumnAttribute
impl FromIterator<ColumnAttribute> for ColumnAttribute
source§fn from_iter<T>(iterator: T) -> ColumnAttributewhere
T: IntoIterator<Item = ColumnAttribute>,
fn from_iter<T>(iterator: T) -> ColumnAttributewhere
T: IntoIterator<Item = ColumnAttribute>,
The bitwise or (|
) of the bits in each flags value.
source§impl Hash for ColumnAttribute
impl Hash for ColumnAttribute
source§impl IntoIterator for ColumnAttribute
impl IntoIterator for ColumnAttribute
§type Item = ColumnAttribute
type Item = ColumnAttribute
§type IntoIter = Iter<ColumnAttribute>
type IntoIter = Iter<ColumnAttribute>
source§fn into_iter(self) -> <ColumnAttribute as IntoIterator>::IntoIter
fn into_iter(self) -> <ColumnAttribute as IntoIterator>::IntoIter
source§impl LowerHex for ColumnAttribute
impl LowerHex for ColumnAttribute
source§impl Not for ColumnAttribute
impl Not for ColumnAttribute
source§fn not(self) -> ColumnAttribute
fn not(self) -> ColumnAttribute
The bitwise negation (!
) of the bits in a flags value, truncating the result.
§type Output = ColumnAttribute
type Output = ColumnAttribute
!
operator.source§impl Octal for ColumnAttribute
impl Octal for ColumnAttribute
source§impl Ord for ColumnAttribute
impl Ord for ColumnAttribute
source§fn cmp(&self, other: &ColumnAttribute) -> Ordering
fn cmp(&self, other: &ColumnAttribute) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for ColumnAttribute
impl PartialEq for ColumnAttribute
source§fn eq(&self, other: &ColumnAttribute) -> bool
fn eq(&self, other: &ColumnAttribute) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ColumnAttribute
impl PartialOrd for ColumnAttribute
source§fn partial_cmp(&self, other: &ColumnAttribute) -> Option<Ordering>
fn partial_cmp(&self, other: &ColumnAttribute) -> 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 ColumnAttribute
impl Serialize for ColumnAttribute
source§impl Sub for ColumnAttribute
impl Sub for ColumnAttribute
source§fn sub(self, other: ColumnAttribute) -> ColumnAttribute
fn sub(self, other: ColumnAttribute) -> ColumnAttribute
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 = ColumnAttribute
type Output = ColumnAttribute
-
operator.source§impl SubAssign for ColumnAttribute
impl SubAssign for ColumnAttribute
source§fn sub_assign(&mut self, other: ColumnAttribute)
fn sub_assign(&mut self, other: ColumnAttribute)
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 ColumnAttribute
impl UpperHex for ColumnAttribute
impl Copy for ColumnAttribute
impl Eq for ColumnAttribute
impl StructuralPartialEq for ColumnAttribute
Auto Trait Implementations§
impl RefUnwindSafe for ColumnAttribute
impl Send for ColumnAttribute
impl Sync for ColumnAttribute
impl Unpin for ColumnAttribute
impl UnwindSafe for ColumnAttribute
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Satn for T
impl<T> Satn for T
source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
f
.source§fn fmt_psql(&self, f: &mut Formatter<'_>) -> Result
fn fmt_psql(&self, f: &mut Formatter<'_>) -> Result
f
.source§fn to_satn(&self) -> String
fn to_satn(&self) -> String
String
.source§fn to_satn_pretty(&self) -> String
fn to_satn_pretty(&self) -> String
String
.