Enum rusqlite::types::ValueRef[][src]

pub enum ValueRef<'a> {
    Null,
    Integer(i64),
    Real(f64),
    Text(&'a [u8]),
    Blob(&'a [u8]),
}
Expand description

A non-owning dynamic type value. Typically the memory backing this value is owned by SQLite.

See Value for an owning dynamic type value.

Variants

Null

The value is a NULL value.

Integer(i64)

The value is a signed integer.

Tuple Fields of Integer

0: i64
Real(f64)

The value is a floating point number.

Tuple Fields of Real

0: f64
Text(&'a [u8])

The value is a text string.

Tuple Fields of Text

0: &'a [u8]
Blob(&'a [u8])

The value is a blob of data

Tuple Fields of Blob

0: &'a [u8]

Implementations

Returns SQLite fundamental datatype.

If self is case Integer, returns the integral value. Otherwise, returns [Err(Error::InvalidColumnType)](crate::Error:: InvalidColumnType).

If self is case Null returns None. If self is case Integer, returns the integral value. Otherwise returns [Err(Error::InvalidColumnType)](crate::Error:: InvalidColumnType).

If self is case Real, returns the floating point value. Otherwise, returns [Err(Error::InvalidColumnType)](crate::Error:: InvalidColumnType).

If self is case Null returns None. If self is case Real, returns the floating point value. Otherwise returns [Err(Error::InvalidColumnType)](crate::Error:: InvalidColumnType).

If self is case Text, returns the string value. Otherwise, returns Err(Error::InvalidColumnType).

If self is case Null returns None. If self is case Text, returns the string value. Otherwise returns [Err(Error::InvalidColumnType)](crate::Error:: InvalidColumnType).

If self is case Blob, returns the byte slice. Otherwise, returns Err(Error::InvalidColumnType).

If self is case Null returns None. If self is case Blob, returns the byte slice. Otherwise returns [Err(Error::InvalidColumnType)](crate::Error:: InvalidColumnType).

Returns the byte slice that makes up this ValueRef if it’s either ValueRef::Blob or ValueRef::Text.

If self is case Null returns None. If self is ValueRef::Blob or ValueRef::Text returns the byte slice that makes up this value

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

Performs the conversion.

Performs the conversion.

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 !=.

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

Performs the conversion.

Performs the conversion.

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

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.