pub enum Value {
Show 28 variants Bool(Option<bool>), TinyInt(Option<i8>), SmallInt(Option<i16>), Int(Option<i32>), BigInt(Option<i64>), TinyUnsigned(Option<u8>), SmallUnsigned(Option<u16>), Unsigned(Option<u32>), BigUnsigned(Option<u64>), Float(Option<f32>), Double(Option<f64>), String(Option<Box<String, Global>>), Char(Option<char>), Bytes(Option<Box<Vec<u8, Global>, Global>>), Json(Option<Box<Value, Global>>), ChronoDate(Option<Box<NaiveDate, Global>>), ChronoTime(Option<Box<NaiveTime, Global>>), ChronoDateTime(Option<Box<NaiveDateTime, Global>>), ChronoDateTimeUtc(Option<Box<DateTime<Utc>, Global>>), ChronoDateTimeLocal(Option<Box<DateTime<Local>, Global>>), ChronoDateTimeWithTimeZone(Option<Box<DateTime<FixedOffset>, Global>>), TimeDate(Option<Box<Date, Global>>), TimeTime(Option<Box<Time, Global>>), TimeDateTime(Option<Box<PrimitiveDateTime, Global>>), TimeDateTimeWithTimeZone(Option<Box<OffsetDateTime, Global>>), Uuid(Option<Box<Uuid, Global>>), Decimal(Option<Box<Decimal, Global>>), BigDecimal(Option<Box<BigDecimal, Global>>),
}
Expand description

Value variants

We want Value to be exactly 1 pointer sized, so anything larger should be boxed.

Variants§

§

Bool(Option<bool>)

§

TinyInt(Option<i8>)

§

SmallInt(Option<i16>)

§

Int(Option<i32>)

§

BigInt(Option<i64>)

§

TinyUnsigned(Option<u8>)

§

SmallUnsigned(Option<u16>)

§

Unsigned(Option<u32>)

§

BigUnsigned(Option<u64>)

§

Float(Option<f32>)

§

Double(Option<f64>)

§

String(Option<Box<String, Global>>)

§

Char(Option<char>)

§

Bytes(Option<Box<Vec<u8, Global>, Global>>)

§

Json(Option<Box<Value, Global>>)

§

ChronoDate(Option<Box<NaiveDate, Global>>)

§

ChronoTime(Option<Box<NaiveTime, Global>>)

§

ChronoDateTime(Option<Box<NaiveDateTime, Global>>)

§

ChronoDateTimeUtc(Option<Box<DateTime<Utc>, Global>>)

§

ChronoDateTimeLocal(Option<Box<DateTime<Local>, Global>>)

§

ChronoDateTimeWithTimeZone(Option<Box<DateTime<FixedOffset>, Global>>)

§

TimeDate(Option<Box<Date, Global>>)

§

TimeTime(Option<Box<Time, Global>>)

§

TimeDateTime(Option<Box<PrimitiveDateTime, Global>>)

§

TimeDateTimeWithTimeZone(Option<Box<OffsetDateTime, Global>>)

§

Uuid(Option<Box<Uuid, Global>>)

§

Decimal(Option<Box<Decimal, Global>>)

§

BigDecimal(Option<Box<BigDecimal, Global>>)

Implementations§

§

impl Value

pub fn unwrap<T>(self) -> Twhere T: ValueType,

pub fn expect<T>(self, msg: &str) -> Twhere T: ValueType,

§

impl Value

pub fn is_json(&self) -> bool

pub fn as_ref_json(&self) -> Option<&Value>

§

impl Value

pub fn is_chrono_date(&self) -> bool

pub fn as_ref_chrono_date(&self) -> Option<&NaiveDate>

§

impl Value

pub fn is_time_date(&self) -> bool

pub fn as_ref_time_date(&self) -> Option<&Date>

§

impl Value

pub fn is_chrono_time(&self) -> bool

pub fn as_ref_chrono_time(&self) -> Option<&NaiveTime>

§

impl Value

pub fn is_time_time(&self) -> bool

pub fn as_ref_time_time(&self) -> Option<&Time>

§

impl Value

§

impl Value

§

impl Value

§

impl Value

§

impl Value

§

impl Value

§

impl Value

§

impl Value

§

impl Value

pub fn is_decimal(&self) -> bool

pub fn as_ref_decimal(&self) -> Option<&Decimal>

pub fn decimal_to_f64(&self) -> Option<f64>

§

impl Value

pub fn is_big_decimal(&self) -> bool

pub fn as_ref_big_decimal(&self) -> Option<&BigDecimal>

pub fn big_decimal_to_f64(&self) -> Option<f64>

§

impl Value

pub fn is_uuid(&self) -> bool

pub fn as_ref_uuid(&self) -> Option<&Uuid>

Trait Implementations§

§

impl Clone for Value

§

fn clone(&self) -> Value

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
§

impl Debug for Value

§

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

Formats the value using the given formatter. Read more
§

impl Display for Value

§

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

Formats the value using the given formatter. Read more
§

impl<'a> From<&'a [u8]> for Value

§

fn from(x: &'a [u8]) -> Value

Converts to this type from the input type.
§

impl From<&String> for Value

§

fn from(x: &String) -> Value

Converts to this type from the input type.
§

impl From<&str> for Value

§

fn from(x: &str) -> Value

Converts to this type from the input type.
§

impl From<BigDecimal> for Value

§

fn from(x: BigDecimal) -> Value

Converts to this type from the input type.
§

impl From<Braced> for Value

§

fn from(x: Braced) -> Value

Converts to this type from the input type.
§

impl From<Cow<'_, str>> for Value

§

fn from(x: Cow<'_, str>) -> Value

Converts to this type from the input type.
§

impl From<Date> for Value

§

fn from(x: Date) -> Value

Converts to this type from the input type.
§

impl From<DateTime<FixedOffset>> for Value

§

fn from(x: DateTime<FixedOffset>) -> Value

Converts to this type from the input type.
§

impl From<DateTime<Local>> for Value

§

fn from(v: DateTime<Local>) -> Value

Converts to this type from the input type.
§

impl From<DateTime<Utc>> for Value

§

fn from(v: DateTime<Utc>) -> Value

Converts to this type from the input type.
§

impl From<Decimal> for Value

§

fn from(x: Decimal) -> Value

Converts to this type from the input type.
§

impl From<Hyphenated> for Value

§

fn from(x: Hyphenated) -> Value

Converts to this type from the input type.
§

impl From<NaiveDate> for Value

§

fn from(x: NaiveDate) -> Value

Converts to this type from the input type.
§

impl From<NaiveDateTime> for Value

§

fn from(x: NaiveDateTime) -> Value

Converts to this type from the input type.
§

impl From<NaiveTime> for Value

§

fn from(x: NaiveTime) -> Value

Converts to this type from the input type.
§

impl From<OffsetDateTime> for Value

§

fn from(v: OffsetDateTime) -> Value

Converts to this type from the input type.
§

impl<T> From<Option<T>> for Valuewhere T: Into<Value> + Nullable,

§

fn from(x: Option<T>) -> Value

Converts to this type from the input type.
§

impl From<PrimitiveDateTime> for Value

§

fn from(x: PrimitiveDateTime) -> Value

Converts to this type from the input type.
§

impl From<Simple> for Value

§

fn from(x: Simple) -> Value

Converts to this type from the input type.
§

impl From<String> for Value

§

fn from(x: String) -> Value

Converts to this type from the input type.
§

impl From<Time> for Value

§

fn from(x: Time) -> Value

Converts to this type from the input type.
§

impl From<Urn> for Value

§

fn from(x: Urn) -> Value

Converts to this type from the input type.
§

impl From<Uuid> for Value

§

fn from(x: Uuid) -> Value

Converts to this type from the input type.
§

impl From<Value> for Value

§

fn from(x: Value) -> Value

Converts to this type from the input type.
§

impl From<Vec<u8, Global>> for Value

§

fn from(x: Vec<u8, Global>) -> Value

Converts to this type from the input type.
§

impl From<bool> for Value

§

fn from(x: bool) -> Value

Converts to this type from the input type.
§

impl From<char> for Value

§

fn from(x: char) -> Value

Converts to this type from the input type.
§

impl From<f32> for Value

§

fn from(x: f32) -> Value

Converts to this type from the input type.
§

impl From<f64> for Value

§

fn from(x: f64) -> Value

Converts to this type from the input type.
§

impl From<i16> for Value

§

fn from(x: i16) -> Value

Converts to this type from the input type.
§

impl From<i32> for Value

§

fn from(x: i32) -> Value

Converts to this type from the input type.
§

impl From<i64> for Value

§

fn from(x: i64) -> Value

Converts to this type from the input type.
§

impl From<i8> for Value

§

fn from(x: i8) -> Value

Converts to this type from the input type.
§

impl From<u16> for Value

§

fn from(x: u16) -> Value

Converts to this type from the input type.
§

impl From<u32> for Value

§

fn from(x: u32) -> Value

Converts to this type from the input type.
§

impl From<u64> for Value

§

fn from(x: u64) -> Value

Converts to this type from the input type.
§

impl From<u8> for Value

§

fn from(x: u8) -> Value

Converts to this type from the input type.
§

impl PartialEq<Value> for Value

§

fn eq(&self, other: &Value) -> 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.
§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnwindSafe for Value

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere 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.

§

impl<V> IntoValueTuple for Vwhere V: Into<Value>,

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere 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 Twhere 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 Twhere 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 Twhere 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.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more