pub enum BitWidth {
U8,
U16,
U32,
}Expand description
The widths a flags set may be declared at.
UNSIGNED ONLY, and the exclusion is two arguments rather than a preference.
- The 64-bit and 128-bit widths are absent for the house carrier table’s reason, which
IntegerWidthalready states: MySQL alone has a nativeu64, no dialect carries a 128-bit integer, and a column has to be storable in every dialect a declaration might reach. - The SIGNED widths are absent because a flag is a BIT and a sign bit is not one.
i8’s top bit is-128, which no declaration would write as an explicit positive value, so the widths that admit it would admit exactly one bit nobody can spell — and the arithmetic every mask word rests on is defined on the unsigned reading.
Variants§
Implementations§
Source§impl BitWidth
impl BitWidth
Sourcepub fn named(word: &str) -> Option<Self>
pub fn named(word: &str) -> Option<Self>
The width this word names, when it is one this kind carries.
Sourcepub const fn count(self) -> u32
pub const fn count(self) -> u32
How many bits a declaration may number, which is also one past the highest legal one.
Sourcepub const fn carried(self) -> IntegerWidth
pub const fn carried(self) -> IntegerWidth
This width on the framework’s own carrier table, which is where the per-dialect widening lives.
The vocabulary kind’s table, spent unchanged: a flags column and an enum column storing the same width are the same column, so a second widening rule here would be a second answer to a question already settled.
Sourcepub const fn stored(self, database: DatabaseKind) -> IntegerWidth
pub const fn stored(self, database: DatabaseKind) -> IntegerWidth
The primitive one database actually binds — this width, widened where that dialect has no such type.
Trait Implementations§
impl Copy for BitWidth
impl Eq for BitWidth
Source§impl Ord for BitWidth
impl Ord for BitWidth
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for BitWidth
impl PartialOrd for BitWidth
impl StructuralPartialEq for BitWidth
Auto Trait Implementations§
impl Freeze for BitWidth
impl RefUnwindSafe for BitWidth
impl Send for BitWidth
impl Sync for BitWidth
impl Unpin for BitWidth
impl UnsafeUnpin for BitWidth
impl UnwindSafe for BitWidth
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
Mutably borrows from an owned value. Read more