#[repr(transparent)]pub struct Layout { /* private fields */ }Expand description
Inline memory layout for raw block.
Implementations§
source§impl Layout
impl Layout
sourcepub const WITH_TABLE_NAME: Self = _
pub const WITH_TABLE_NAME: Self = _
With table name in the block.
sourcepub const WITH_FIELD_NAMES: Self = _
pub const WITH_FIELD_NAMES: Self = _
With field names.
sourcepub const WITH_GROUP_ID: Self = _
pub const WITH_GROUP_ID: Self = _
If raw data block contains group id.
sourcepub const WITH_FIELD_SCHEMA: Self = _
pub const WITH_FIELD_SCHEMA: Self = _
If raw data contains schema
sourcepub const NCHAR_IS_DECODED: Self = _
pub const NCHAR_IS_DECODED: Self = _
If NChar decoded or not in data block.
sourcepub const SCHEMA_CHANGED: Self = _
pub const SCHEMA_CHANGED: Self = _
If Schema has been changed, eg. subset or added some columns.
sourcepub const INLINE_DEFAULT: Self = _
pub const INLINE_DEFAULT: Self = _
Inline with full raw layout, this is the default behavior.
+-----+----+----+-----+------+---+---+------+-------+------------+
|flags|rows|cols|table|fields|len|gid|schema|lengths| data |
+-----+----+----+-----+------+---+---+------+-------+------------+
|2 |4 |4 | dyn | dyn | 4 | 8 |cols*6|cols*4 |sum(lengths)|
+-----+----+----+-----+------+---+---+------+-------+------------+
sourcepub const INLINE_AS_RAW_BLOCK: Self = _
pub const INLINE_AS_RAW_BLOCK: Self = _
Inline as raw block only, without table names and field names.
+-----+----+----+---+---+------+-------+------------+
|flags|rows|cols|len|gid|schema|lengths| data |
+-----+----+----+---+---+------+-------+------------+
|2 |4 |4 |4 | 8 |cols*6|cols*4 |sum(lengths)|
+-----+----+----+---+---+------+-------+------------+
sourcepub const INLINE_AS_DATA_ONLY: Self = _
pub const INLINE_AS_DATA_ONLY: Self = _
Inline as data only to save space.
+-----+----+----+-------+------------|
|flags|rows|cols|lengths| data |
+-----+----+----+-------+------------|
|2 |4 |4 |cols*4 |sum(lengths)|
+-----+----+----+-------+------------|
sourcepub const PRECISION_MASK: Self = _
pub const PRECISION_MASK: Self = _
Precision mask.
pub const PRECISION_CLEAR_MASK: Self = _
pub const IS_MILLIS: Self = _
pub const IS_MICROS: Self = _
pub const IS_NANOS: Self = _
pub const FORMAT_MASK: Self = _
sourcepub const IS_RAW_DATA: Self = _
pub const IS_RAW_DATA: Self = _
is raw data
sourcepub const IS_RAW_META: Self = _
pub const IS_RAW_META: Self = _
is raw meta
sourcepub const IS_STB_DATA: Self = _
pub const IS_STB_DATA: Self = _
Is STable data, contains sql schema and table name - tags map.
sourcepub const fn from_bits(bits: u32) -> Option<Self>
pub const fn from_bits(bits: u32) -> Option<Self>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: u32) -> Self
pub const fn from_bits_truncate(bits: u32) -> Self
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> Self
pub const unsafe fn from_bits_unchecked(bits: u32) -> Self
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: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Returns true if there are flags common to both self and other.
sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Returns true if all of the flags in other are contained within self.
sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Inserts or removes the specified flags depending on the passed value.
sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
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: Self) -> Self
pub const fn union(self, other: Self) -> Self
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: Self) -> Self
pub const fn difference(self, other: Self) -> Self
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: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
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) -> Self
pub const fn complement(self) -> Self
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.
source§impl Layout
impl Layout
pub fn precision(&self) -> Precision
pub fn expect_table_name(&self) -> bool
pub fn with_table_name(&mut self) -> &mut Self
pub fn expect_field_names(&self) -> bool
pub fn with_field_names(&mut self) -> &mut Self
pub fn nchar_is_decoded(&self) -> bool
pub fn with_nchar_decoded(&mut self) -> &mut Self
pub fn with_precision(&mut self, precision: Precision) -> &mut Self
pub fn with_schema_changed(self) -> Self
pub fn set_schema_changed(&mut self, value: bool) -> &mut Self
pub fn schema_changed(&self) -> bool
pub fn inline_format(&self) -> InlineFormat
pub fn as_inner(&self) -> u32
Trait Implementations§
source§impl BitAndAssign<Layout> for Layout
impl BitAndAssign<Layout> for Layout
source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Disables all flags disabled in the set.
source§impl BitOrAssign<Layout> for Layout
impl BitOrAssign<Layout> for Layout
source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Adds the set of flags.
source§impl BitXorAssign<Layout> for Layout
impl BitXorAssign<Layout> for Layout
source§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
Toggles the set of flags.
source§impl Extend<Layout> for Layout
impl Extend<Layout> for Layout
source§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
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<Layout> for Layout
impl FromIterator<Layout> for Layout
source§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
source§impl Ord for Layout
impl Ord for Layout
source§impl PartialEq<Layout> for Layout
impl PartialEq<Layout> for Layout
source§impl PartialOrd<Layout> for Layout
impl PartialOrd<Layout> for Layout
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 SubAssign<Layout> for Layout
impl SubAssign<Layout> for Layout
source§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
Disables all flags enabled in the set.