pub enum IntegerWidth {
I8,
I16,
I32,
I64,
U8,
U16,
U32,
}Expand description
The width a vocabulary’s discriminant is stored at — every integer #[repr(…)] the house’s
carrier table can carry, and no other.
u64 is deliberately absent, and its absence is the table’s rather than an oversight: MySQL has
a native u64 and SQLite and Postgres have none, so a u64-wide vocabulary would be storable in
one of the three dialects. usize and isize are absent because they name no fixed width at
all, and i128/u128 because no dialect carries one.
Variants§
I8
i8.
I16
i16.
I32
i32.
I64
i64 — also the width a declaration with no #[repr(…)] takes.
U8
u8.
U16
u16.
U32
u32.
Implementations§
Source§impl IntegerWidth
impl IntegerWidth
Sourcepub const DEFAULT: Self = Self::I64
pub const DEFAULT: Self = Self::I64
The width a declaration with no integer #[repr(…)] takes — see the module note for why it is
the widest rather than the narrowest.
Sourcepub const UNCARRIED: [&'static str; 5]
pub const UNCARRIED: [&'static str; 5]
Rust’s integer #[repr(…)] hints this framework cannot store, in the order a refusal lists
them.
Sourcepub fn named(word: &str) -> Option<Self>
pub fn named(word: &str) -> Option<Self>
The width this word names, when it is one this framework carries.
Sourcepub fn is_repr_word(word: &str) -> bool
pub fn is_repr_word(word: &str) -> bool
Whether word is one of Rust’s INTEGER repr hints at all, carried here or not.
The question a #[repr(…)] walk asks before refusing: C, align(…), packed and
transparent are hints about LAYOUT that say nothing about a stored width, and an enum
carrying one is not a declaration this framework has anything to object to.
Sourcepub const fn wire(self, database: DatabaseKind) -> Self
pub const fn wire(self, database: DatabaseKind) -> Self
The primitive this database actually binds — the house widening, which only Postgres does.
It is the framework’s own widened_carriers! table restated for a vocabulary: Postgres has no
unsigned types and no TINYINT, so i8 and u8 bind as i16, u16 as i32 and u32 as
i64. Every widening is lossless by construction — the target holds the source’s whole range —
which is what makes an as cast to it exact rather than merely plausible.