Skip to main content

MysqlIntWidth

Enum MysqlIntWidth 

Source
pub enum MysqlIntWidth {
    Tiny,
    Small,
    Medium,
    Int,
    Big,
}
Expand description

v7.39 (round 386, type-fidelity epic P1) — the declared MySQL narrow integer type for a column whose storage DataType cannot express it. MySQL TINYINT (i8, -128..127) collapses to DataType::SmallInt (i16) and MEDIUMINT (24-bit) to DataType::Int (i32) — both wider than the declared type, so a range check against ty alone accepts out-of-range values (INSERT 128 INTO TINYINT is stored silently where MariaDB strict raises ERROR 1264). This annotation records the lost width so the write path (epic P2) can enforce the real bounds. SMALLINT / INT / BIGINT need no marker — their storage DataType is already faithful. Sparse: only TINYINT / MEDIUMINT columns carry it; persisted in the FILE_VERSION 81+ appendix, older catalogs deserialise as None.

Variants§

§

Tiny

MySQL TINYINT — signed -128..127, unsigned 0..255. Storage i16.

§

Small

MySQL SMALLINT UNSIGNED — 0..65535. Storage widened to i32 (a signed SMALLINT keeps DataType::SmallInt and carries no marker).

§

Medium

MySQL MEDIUMINT — signed -8388608..8388607, unsigned 0..16777215. Storage i32.

§

Int

MySQL INT UNSIGNED — 0..4294967295. Storage widened to i64 (a signed INT keeps DataType::Int and carries no marker).

§

Big

v7.39 (round 471, epic P4b) — MySQL BIGINT UNSIGNED — 0..18446744073709551615. i64 stops at 2^63-1, so the storage tag is widened to Numeric (i128-backed, scale 0), which already compares, orders, indexes and renders as an exact integer. A signed BIGINT keeps DataType::BigInt and carries no marker.

Trait Implementations§

Source§

impl Clone for MysqlIntWidth

Source§

fn clone(&self) -> MysqlIntWidth

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MysqlIntWidth

Source§

impl Debug for MysqlIntWidth

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for MysqlIntWidth

Source§

impl PartialEq for MysqlIntWidth

Source§

fn eq(&self, other: &MysqlIntWidth) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MysqlIntWidth

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.