[][src]Enum sdlang::Value

pub enum Value {
    String(String),
    Base64(Vec<u8>),
    Date(Date),
    DateTime(DateTime),
    Duration(Duration),
    Number(i128),
    Decimal(f64),
    Boolean(bool),
    Null,
}

The value type encasing all possible SDLang value types.

This covers every single SDLang value there is. It forms a shell around any of them, allowing them to stored and used easily.

It implements FromStr to allow direct parsing, as well as From for all its subtypes (except Null).

Variants

String(String)

Text types. Both normal and raw strings come under this.

Base64(Vec<u8>)

Base64 binary data, in the form of a series of bytes.

Date(Date)

Date. Not timezone-aware.

DateTime(DateTime)

Date and time, timezone-aware.

Duration(Duration)

Durations of time.

Number(i128)

Integers.

Decimal(f64)

Decimals (floating-point).

Boolean(bool)

Boolean values.

Null

Null.

Trait Implementations

impl PartialEq<Value> for Value[src]

impl From<String> for Value[src]

fn from(v: String) -> Self[src]

Creates a Value::String from the given string.

impl<'_> From<&'_ str> for Value[src]

fn from(v: &str) -> Self[src]

Creates a Value::String from the given string, allocating.

impl From<Vec<u8>> for Value[src]

fn from(v: Vec<u8>) -> Self[src]

Creates a Value::Base64 from the given data.

impl From<NaiveDate> for Value[src]

fn from(v: Date) -> Self[src]

Creates a Value::Date from the given date.

impl From<DateTime<FixedOffset>> for Value[src]

fn from(v: DateTime) -> Self[src]

Creates a Value::DateTime from the given date and time.

impl From<Duration> for Value[src]

fn from(v: Duration) -> Self[src]

Creates a Value::Duration from the given duration.

impl From<i128> for Value[src]

fn from(v: i128) -> Self[src]

Creates a Value::Number from the given integer.

impl From<f64> for Value[src]

fn from(v: f64) -> Self[src]

Creates a Value::Decimal from the given decimal.

impl From<bool> for Value[src]

fn from(v: bool) -> Self[src]

Creates a Value::Boolean from the given bool.

impl Display for Value[src]

fn fmt(&self, f: &mut Formatter) -> Result[src]

Displays the value in a human-readable format.

The type of the result is (should be) always distinguishable based on the format used.

impl Debug for Value[src]

fn fmt(&self, f: &mut Formatter) -> Result[src]

Formats the same way as fmt::Display. This is done so that excessive output is not shown in any debug output, since no information is lost in using the typical format.

impl FromStr for Value[src]

type Err = Error

The associated error which can be returned from parsing.

fn from_str(s: &str) -> Result<Self>[src]

Parses the text for a Value, returning a parse error on failure.

Auto Trait Implementations

impl Send for Value

impl Sync for Value

Blanket Implementations

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.