Trait spanner_rs::ToSpanner[][src]

pub trait ToSpanner {
    fn to_spanner(&self) -> Result<Value, Error>;
fn spanner_type() -> Type
    where
        Self: Sized
; }
Expand description

A trait for Rust types that can be converted to Cloud Spanner values.

Types

The crate provides the following mapping between Cloud Spanner types and Rust types.

Rust TypeSpanner Type
boolBool
u8, i8, u16, i16, u32, i32, i64Int64
f64Float64
&str, StringString
bigdecimal::BigDecimalNumeric
&[u8], BytesBytes

Nullability

ToSpanner is implemented for Option<T> when T implements ToSpanner. Option<T> represents a nullable Spanner value.

Arrays

ToSpanner is implemented for Vec<T> when T implements ToSpanner. Such values map to Spanner’s Array type. Arrays may contain null values (i.e.: Vec<Option<T>>). Note that Vec<Vec<T>> is not allowed.

Required methods

Creates a new Cloud Spanner value from this value.

Returns the Cloud Spanner Type that this implementation produces.

Implementations on Foreign Types

Implementors