Skip to main content

Type

Trait Type 

Source
pub trait Type:
    FromSql
    + ToSql
    + Sealed {
    const SQL_TYPE: SqlType;
}
Expand description

The type of the keys or values that are stored in an SQLiteMap or an SQLiteSet.

Currently, the following types are supported:

TypeSQLite storage datatype
i32INTEGER
u32INTEGER
i64INTEGER
Vec<u8>, alias BlobBLOB
StringTEXT

 

Type u64 is not currently supported directly, because SQLite’s INTEGER datatype is (at most) 64-Bit in size and is always signed; it can not store values greater than i64::MAX. To store u64 keys or values, please use value as i64 to convert the keys or value to i64 before insertion. This can be reverted, after a key or value has been read, with value as u64.

Required Associated Constants§

Source

const SQL_TYPE: SqlType

The SQLite storage datatype that corresponds to this type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Type for String

Source§

const SQL_TYPE: SqlType

Source§

impl Type for i32

Source§

const SQL_TYPE: SqlType

Source§

impl Type for i64

Source§

const SQL_TYPE: SqlType

Source§

impl Type for u32

Source§

const SQL_TYPE: SqlType

Implementors§

Source§

impl Type for Blob

Source§

const SQL_TYPE: SqlType