mirror of
https://github.com/isar/rusqlite.git
synced 2025-09-16 04:32:19 +08:00
Fix missing docs
This commit is contained in:
@@ -86,6 +86,7 @@ pub type FromSqlResult<T> = Result<T, FromSqlError>;
|
||||
/// fetching values as i64 and then doing the interpretation themselves or by
|
||||
/// defining a newtype and implementing `FromSql`/`ToSql` for it.
|
||||
pub trait FromSql: Sized {
|
||||
/// Converts SQLite value into Rust value.
|
||||
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self>;
|
||||
}
|
||||
|
||||
|
@@ -82,12 +82,19 @@ mod value_ref;
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct Null;
|
||||
|
||||
/// SQLite data types.
|
||||
/// See [Fundamental Datatypes](https://sqlite.org/c3ref/c_blob.html).
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum Type {
|
||||
/// NULL
|
||||
Null,
|
||||
/// 64-bit signed integer
|
||||
Integer,
|
||||
/// 64-bit IEEE floating point number
|
||||
Real,
|
||||
/// String
|
||||
Text,
|
||||
/// BLOB
|
||||
Blob,
|
||||
}
|
||||
|
||||
|
@@ -87,6 +87,7 @@ impl ToSql for ToSqlOutput<'_> {
|
||||
|
||||
/// A trait for types that can be converted into SQLite values.
|
||||
pub trait ToSql {
|
||||
/// Converts Rust value to SQLite value
|
||||
fn to_sql(&self) -> Result<ToSqlOutput<'_>>;
|
||||
}
|
||||
|
||||
|
@@ -109,6 +109,7 @@ where
|
||||
}
|
||||
|
||||
impl Value {
|
||||
/// Returns SQLite fundamental datatype.
|
||||
pub fn data_type(&self) -> Type {
|
||||
match *self {
|
||||
Value::Null => Type::Null,
|
||||
|
@@ -20,6 +20,7 @@ pub enum ValueRef<'a> {
|
||||
}
|
||||
|
||||
impl ValueRef<'_> {
|
||||
/// Returns SQLite fundamental datatype.
|
||||
pub fn data_type(&self) -> Type {
|
||||
match *self {
|
||||
ValueRef::Null => Type::Null,
|
||||
|
Reference in New Issue
Block a user