Enum butane::SqlVal[][src]

pub enum SqlVal {
    Null,
    Bool(bool),
    Int(i32),
    BigInt(i64),
    Real(f64),
    Text(String),
    Blob(Vec<u8, Global>),
    Timestamp(NaiveDateTime),
    Custom(Box<SqlValCustom, Global>),
}
Expand description

A database value.

For conversion between SqlVal and other types, see FromSql and ToSql.

Variants

Null
Bool(bool)
Int(i32)
BigInt(i64)
Real(f64)
Text(String)
Blob(Vec<u8, Global>)
Timestamp(NaiveDateTime)

Implementations

Tests if this sqlval is compatible with the given SqlType. There are no implicit type conversions (i.e. if this is a SqlVal::Bool, it is only compatible with SqlType::Bool, not with SqlType::Int, even though an int contains enough information to encode a bool.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Converts the value of self into the binary format of the specified Postgres Type, appending it to out. Read more

Determines if a value of this type can be converted to the specified Postgres Type. Read more

An adaptor method used internally by Rust-Postgres. Read more

Converts Rust value to SQLite value

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns a reference to self as a ToSql trait object.

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.