Enum assembly_fdb_core::value::Value

source ·
pub enum Value<T: Context> {
    Nothing,
    Integer(i32),
    Float(f32),
    Text(T::String),
    Boolean(bool),
    BigInt(T::I64),
    VarChar(T::XML),
}
Expand description

A single field value in the database

This is a generic enum that is the template for all other Field types in this crate.

Variants§

§

Nothing

The NULL value

§

Integer(i32)

A 32 bit integer

§

Float(f32)

A 32 bit IEEE floating point number

§

Text(T::String)

A string

§

Boolean(bool)

A boolean

§

BigInt(T::I64)

A 64 bit integer

§

VarChar(T::XML)

A (XML?) string

Implementations§

source§

impl<T: Context> Value<T>

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::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::I64>

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

source

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

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

Trait Implementations§

source§

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

source§

fn clone(&self) -> Self

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 + Context> Debug for Value<T>
where T::String: Debug, T::I64: Debug, T::XML: Debug,

source§

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

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

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

source§

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

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

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

source§

fn hash(&self) -> u32

Get the hash value
source§

impl<T: Context> From<&Value<T>> for ValueType

source§

fn from(val: &Value<T>) -> Self

Converts to this type from the input type.
source§

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

source§

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

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

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

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

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

source§

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

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

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

Auto Trait Implementations§

§

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

§

impl<T> RefUnwindSafe for Value<T>

§

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

§

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

§

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

§

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

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.