IsValue

Trait IsValue 

Source
pub trait IsValue: Sized + Clone {
    const TY: Ty;

    // Provided methods
    fn is_null(&self) -> bool { ... }
    fn is_primitive(&self) -> bool { ... }
    fn fixed_length(&self) -> usize { ... }
    fn as_timestamp(&self) -> i64 { ... }
    fn as_var_char(&self) -> &str { ... }
    fn as_nchar(&self) -> &str { ... }
    fn as_medium_blob(&self) -> &[u8]  { ... }
    fn as_blob(&self) -> &[u8]  { ... }
}

Required Associated Constants§

Source

const TY: Ty

Provided Methods§

Source

fn is_null(&self) -> bool

Source

fn is_primitive(&self) -> bool

Source

fn fixed_length(&self) -> usize

Source

fn as_timestamp(&self) -> i64

Source

fn as_var_char(&self) -> &str

Source

fn as_nchar(&self) -> &str

Source

fn as_medium_blob(&self) -> &[u8]

Source

fn as_blob(&self) -> &[u8]

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> IsValue for Option<T>
where T: IsValue,

Source§

const TY: Ty = T::TY

Source§

fn is_null(&self) -> bool

Source§

fn is_primitive(&self) -> bool

Source§

fn as_timestamp(&self) -> i64

Source§

fn as_var_char(&self) -> &str

Source§

fn as_nchar(&self) -> &str

Source§

fn as_medium_blob(&self) -> &[u8]

Source§

fn as_blob(&self) -> &[u8]

Implementors§

Source§

impl IsValue for INChar

Source§

const TY: Ty = Ty::NChar

Source§

impl IsValue for ITimestamp

Source§

const TY: Ty = Ty::Timestamp

Source§

impl IsValue for IVarChar

Source§

const TY: Ty = Ty::VarChar

Source§

impl IsValue for IBigInt

Source§

const TY: Ty = Ty::BigInt

Source§

impl IsValue for IBool

Source§

const TY: Ty = Ty::Bool

Source§

impl IsValue for IDecimal

Source§

const TY: Ty = Ty::Decimal

Source§

impl IsValue for IDouble

Source§

const TY: Ty = Ty::Double

Source§

impl IsValue for IFloat

Source§

const TY: Ty = Ty::Float

Source§

impl IsValue for IInt

Source§

const TY: Ty = Ty::Int

Source§

impl IsValue for ISmallInt

Source§

const TY: Ty = Ty::SmallInt

Source§

impl IsValue for ITinyInt

Source§

const TY: Ty = Ty::TinyInt

Source§

impl IsValue for IUBigInt

Source§

const TY: Ty = Ty::UBigInt

Source§

impl IsValue for IUInt

Source§

const TY: Ty = Ty::UInt

Source§

impl IsValue for IUSmallInt

Source§

const TY: Ty = Ty::USmallInt

Source§

impl IsValue for IUTinyInt

Source§

const TY: Ty = Ty::UTinyInt