Enum oneline_template::function_executor::Value[][src]

pub enum Value {
    String(String),
    Bool(bool),
    Bytes(Vec<u8>),
    Char(char),
    Option(Option<Box<Value>>),
    UInt(u128),
    Int(i128),
    Float(f64),
}

The value used for templating.

Automatic convertation into string

  • string -> string
  • char -> string
  • uint -> string using decimal base.
  • int -> string using decimal base with sign.
  • bytes -> utf-8 encoded string or error
  • bool -> error. For convertation boolean type use bool:to_string
  • option -> error. For convertation option use string:unwrap_or, uint:unwrap_or or others.
  • float -> error. For convertation option use float:to_string.

Variants

String(String)

Value that contains string type.

Bool(bool)

Value that contains boolean type.

Bytes(Vec<u8>)

Value that contains array of bytes.

Char(char)

Value that contains char.

Option(Option<Box<Value>>)

Value that may contain other value.

UInt(u128)

Value that contains unsigned 128-bit integer.

Int(i128)

Value that contains signed 128-bit integer.

Float(f64)

Value that contains float value.

Implementations

impl Value[src]

pub fn as_string(&self) -> Result<&String, FunctionError>[src]

Trying to cast value as string.

pub fn as_mut_string(&mut self) -> Result<&mut String, FunctionError>[src]

Trying to cast value as mutable string.

pub fn into_string(self) -> Result<String, FunctionError>[src]

Trying to cast value as string.

pub fn as_bool(&self) -> Result<&bool, FunctionError>[src]

Trying to cast value as bool.

pub fn as_mut_bool(&mut self) -> Result<&mut bool, FunctionError>[src]

Trying to cast value as mutable bool.

pub fn into_bool(self) -> Result<bool, FunctionError>[src]

Trying to cast value as bool.

pub fn as_bytes(&self) -> Result<&Vec<u8>, FunctionError>[src]

Trying to cast value as bytes.

pub fn as_mut_bytes(&mut self) -> Result<&mut Vec<u8>, FunctionError>[src]

Trying to cast value as mutable bytes.

pub fn into_bytes(self) -> Result<Vec<u8>, FunctionError>[src]

Trying to cast value as bytes.

pub fn as_char(&self) -> Result<&char, FunctionError>[src]

Trying to cast value as char.

pub fn as_mut_char(&mut self) -> Result<&mut char, FunctionError>[src]

Trying to cast value as mutable char.

pub fn as_option(&self) -> Result<Option<&Value>, FunctionError>[src]

Trying to cast value as option.

pub fn as_mut_option(&mut self) -> Result<Option<&mut Value>, FunctionError>[src]

Trying to cast value as mutable option.

pub fn into_option(self) -> Result<Option<Value>, FunctionError>[src]

Trying to cast value as option.

pub fn as_uint(&self) -> Result<&u128, FunctionError>[src]

Trying to cast value as uint.

pub fn as_mut_uint(&mut self) -> Result<&mut u128, FunctionError>[src]

Trying to cast value as mutable uint.

pub fn into_uint(self) -> Result<u128, FunctionError>[src]

Trying to cast value as uint.

pub fn as_int(&self) -> Result<&i128, FunctionError>[src]

Trying to cast value as int.

pub fn as_mut_int(&mut self) -> Result<&mut i128, FunctionError>[src]

Trying to cast value as mutable int.

pub fn into_int(self) -> Result<i128, FunctionError>[src]

Trying to cast value as int.

pub fn as_float(&self) -> Result<&f64, FunctionError>[src]

Trying to cast value as float.

pub fn as_mut_float(&mut self) -> Result<&mut f64, FunctionError>[src]

Trying to cast value as mutable float.

pub fn floato_float(self) -> Result<f64, FunctionError>[src]

Trying to cast value as float.

Trait Implementations

impl Debug for Value[src]

impl Serialize for Value[src]

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

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.