Enum query_builder::Value
[−]
[src]
pub enum Value<'c> { Varchar(&'c str), Bool(bool), Tinyint(i8), UnsignedTinyint(u8), Smallint(i16), UnsignedSmallint(u16), Int(i32), UnsignedInt(u32), Bigint(i64), UnsignedBigint(u64), }
Enum representing common SQL-datatypes
Variants
Varchar(&'c str)
Bool(bool)
Tinyint(i8)
UnsignedTinyint(u8)
Smallint(i16)
UnsignedSmallint(u16)
Int(i32)
UnsignedInt(u32)
Bigint(i64)
UnsignedBigint(u64)
Methods
impl<'c> Value<'c>
[src]
pub fn as_string(&self) -> String
[src]
Convert the Value to a String
Example
use query_builder::Value; // Put single quotes around the varchar to not conflict with e.g. MySQL when inserting data let v = Value::Varchar("steven"); assert_eq!(v.as_string(), "'steven'"); // Bools are written in caps to make them stand out in queries let v = Value::Bool(true); assert_eq!(v.as_string(), "TRUE"); // applies to all numeric Values let v = Value::Int(42); assert_eq!(v.as_string(), "42");
Trait Implementations
impl<'c> Debug for Value<'c>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'c> Clone for Value<'c>
[src]
fn clone(&self) -> Value<'c>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'c> Eq for Value<'c>
[src]
impl<'c> PartialEq for Value<'c>
[src]
fn eq(&self, __arg_0: &Value<'c>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Value<'c>) -> bool
[src]
This method tests for !=
.
impl<'c> Ord for Value<'c>
[src]
fn cmp(&self, __arg_0: &Value<'c>) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
impl<'c> PartialOrd for Value<'c>
[src]
fn partial_cmp(&self, __arg_0: &Value<'c>) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Value<'c>) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Value<'c>) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Value<'c>) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Value<'c>) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'c> Display for Value<'c>
[src]
fn fmt(&self, f: &mut Formatter) -> FormatResult
[src]
Formats the value using the given formatter. Read more