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.

Real(f64)

The value is a floating point number.

Text(&'a [u8])

The value is a text string.

Blob(&'a [u8])

The value is a blob of data

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
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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 the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.