Type Alias assembly_fdb::core::Field

source ·
pub type Field = Value<OwnedContext>;
Expand description

An owned field value

Aliased Type§

enum Field {
    Nothing,
    Integer(i32),
    Float(f32),
    Text(String),
    Boolean(bool),
    BigInt(i64),
    VarChar(String),
}

Variants§

§

Nothing

The NULL value

§

Integer(i32)

A 32 bit integer

§

Float(f32)

A 32 bit IEEE floating point number

§

Text(String)

A string

§

Boolean(bool)

A boolean

§

BigInt(i64)

A 64 bit integer

§

VarChar(String)

A (XML?) string

Implementations§

source§

impl<T> Value<T>where T: Context,

source

pub fn map<O, M>(&self, mapper: &mut M) -> Value<O>where O: Context, M: ValueMapperMut<T, O>,

Creates a value of a different context using the given mapper

source

pub fn into_opt_integer(self) -> Option<i32>

Returns Some with the value if the field contains an Value::Integer.

source

pub fn into_opt_float(self) -> Option<f32>

Returns Some with the value if the field contains a Value::Float.

source

pub fn into_opt_text(self) -> Option<<T as Context>::String>

Returns Some with the value if the field contains a Value::Text.

source

pub fn into_opt_boolean(self) -> Option<bool>

Returns Some with the value if the field contains a Value::Boolean.

source

pub fn into_opt_big_int(self) -> Option<<T as Context>::I64>

Returns Some with the value if the field contains a Value::BigInt.

source

pub fn into_opt_varchar(self) -> Option<<T as Context>::XML>

Returns Some with the value if the field contains a Value::VarChar.

Trait Implementations§

source§

impl<T> Clone for Value<T>where T: Context, <T as Context>::String: Clone, <T as Context>::XML: Clone, <T as Context>::I64: Clone,

source§

fn clone(&self) -> Value<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> Debug for Value<T>where T: Debug + Context, <T as Context>::String: Debug, <T as Context>::I64: Debug, <T as Context>::XML: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<C> Display for Value<C>where C: Context, <C as Context>::I64: Debug, <C as Context>::String: Debug, <C as Context>::XML: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<C> FdbHash for Value<C>where C: Context, <C as Context>::I64: FdbHash, <C as Context>::String: FdbHash, <C as Context>::XML: FdbHash,

source§

fn hash(&self) -> u32

Get the hash value
source§

impl<C1, C2> PartialEq<Value<C1>> for Value<C2>where C1: Context, C2: Context, <C1 as Context>::I64: PartialEq<<C2 as Context>::I64>, <C1 as Context>::String: PartialEq<<C2 as Context>::String>, <C1 as Context>::XML: PartialEq<<C2 as Context>::XML>,

source§

fn eq(&self, other: &Value<C1>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> Serialize for Value<T>where T: Context, <T as Context>::String: Serialize, <T as Context>::I64: Serialize, <T as Context>::XML: Serialize,

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl ToSql for Value<OwnedContext>

source§

fn to_sql(&self) -> Result<ToSqlOutput<'_>, Error>

Converts Rust value to SQLite value
source§

impl<T> Copy for Value<T>where T: Context, <T as Context>::String: Copy, <T as Context>::XML: Copy, <T as Context>::I64: Copy,