Enum assembly_fdb::value::Value
pub enum Value<T>where
T: Context,{
Nothing,
Integer(i32),
Float(f32),
Text(<T as Context>::String),
Boolean(bool),
BigInt(<T as Context>::I64),
VarChar(<T as Context>::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 as Context>::String)
A string
Boolean(bool)
A boolean
BigInt(<T as Context>::I64)
A 64 bit integer
VarChar(<T as Context>::XML)
A (XML?) string
Implementations§
§impl<T> Value<T>where
T: Context,
impl<T> Value<T>where T: Context,
pub fn map<O, M>(&self, mapper: &mut M) -> Value<O>where
O: Context,
M: ValueMapperMut<T, O>,
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
pub fn into_opt_integer(self) -> Option<i32>
pub fn into_opt_integer(self) -> Option<i32>
Returns Some
with the value if the field contains an Value::Integer
.
pub fn into_opt_float(self) -> Option<f32>
pub fn into_opt_float(self) -> Option<f32>
Returns Some
with the value if the field contains a Value::Float
.
pub fn into_opt_text(self) -> Option<<T as Context>::String>
pub fn into_opt_text(self) -> Option<<T as Context>::String>
Returns Some
with the value if the field contains a Value::Text
.
pub fn into_opt_boolean(self) -> Option<bool>
pub fn into_opt_boolean(self) -> Option<bool>
Returns Some
with the value if the field contains a Value::Boolean
.
pub fn into_opt_big_int(self) -> Option<<T as Context>::I64>
pub fn into_opt_big_int(self) -> Option<<T as Context>::I64>
Returns Some
with the value if the field contains a Value::BigInt
.
pub fn into_opt_varchar(self) -> Option<<T as Context>::XML>
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§
§impl<T> Clone for Value<T>where
T: Context,
<T as Context>::String: Clone,
<T as Context>::XML: Clone,
<T as Context>::I64: Clone,
impl<T> Clone for Value<T>where T: Context, <T as Context>::String: Clone, <T as Context>::XML: Clone, <T as Context>::I64: Clone,
§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,
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,
§impl<C> Display for Value<C>where
C: Context,
<C as Context>::I64: Debug,
<C as Context>::String: Debug,
<C as Context>::XML: Debug,
impl<C> Display for Value<C>where C: Context, <C as Context>::I64: Debug, <C as Context>::String: Debug, <C as Context>::XML: Debug,
§impl<C> FdbHash for Value<C>where
C: Context,
<C as Context>::I64: FdbHash,
<C as Context>::String: FdbHash,
<C as Context>::XML: FdbHash,
impl<C> FdbHash for Value<C>where C: Context, <C as Context>::I64: FdbHash, <C as Context>::String: FdbHash, <C as Context>::XML: FdbHash,
§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>,
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>,
§impl<T> Serialize for Value<T>where
T: Context,
<T as Context>::String: Serialize,
<T as Context>::I64: Serialize,
<T as Context>::XML: Serialize,
impl<T> Serialize for Value<T>where T: Context, <T as Context>::String: Serialize, <T as Context>::I64: Serialize, <T as Context>::XML: Serialize,
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
§impl<'a> ToSql for Value<MemContext<'a>>
impl<'a> ToSql for Value<MemContext<'a>>
§impl ToSql for Value<OwnedContext>
impl ToSql for Value<OwnedContext>
§impl TryFrom<FDBFieldData> for Value<FileContext>
impl TryFrom<FDBFieldData> for Value<FileContext>
§type Error = UnknownValueType
type Error = UnknownValueType
The type returned in the event of a conversion error.
§fn try_from(
value: FDBFieldData
) -> Result<Value<FileContext>, <Value<FileContext> as TryFrom<FDBFieldData>>::Error>
fn try_from( value: FDBFieldData ) -> Result<Value<FileContext>, <Value<FileContext> as TryFrom<FDBFieldData>>::Error>
Performs the conversion.
impl<T> Copy for Value<T>where T: Context, <T as Context>::String: Copy, <T as Context>::XML: Copy, <T as Context>::I64: Copy,
Auto Trait Implementations§
impl<T> RefUnwindSafe for Value<T>where <T as Context>::I64: RefUnwindSafe, <T as Context>::String: RefUnwindSafe, <T as Context>::XML: RefUnwindSafe,
impl<T> Send for Value<T>where <T as Context>::I64: Send, <T as Context>::String: Send, <T as Context>::XML: Send,
impl<T> Sync for Value<T>where <T as Context>::I64: Sync, <T as Context>::String: Sync, <T as Context>::XML: Sync,
impl<T> Unpin for Value<T>where <T as Context>::I64: Unpin, <T as Context>::String: Unpin, <T as Context>::XML: Unpin,
impl<T> UnwindSafe for Value<T>where <T as Context>::I64: UnwindSafe, <T as Context>::String: UnwindSafe, <T as Context>::XML: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more