Fix missing docs

This commit is contained in:
gwenn
2020-05-17 11:21:10 +02:00
committed by Thom Chiovoloni
parent 8a08dff115
commit 76fc22c653
14 changed files with 87 additions and 8 deletions

View File

@@ -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>;
}

View File

@@ -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,
}

View File

@@ -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<'_>>;
}

View File

@@ -109,6 +109,7 @@ where
}
impl Value {
/// Returns SQLite fundamental datatype.
pub fn data_type(&self) -> Type {
match *self {
Value::Null => Type::Null,

View File

@@ -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,