Enum gtmpl::Value
[−]
[src]
pub enum Value { NoValue, Nil, Bool(bool), String(String), Object(HashMap<String, Value, RandomState>), Map(HashMap<String, Value, RandomState>), Array(Vec<Value>), Function(Function), Number(Number), }
Represents a gtmpl value.
Variants
NoValue
Nil
Bool(bool)
String(String)
Object(HashMap<String, Value, RandomState>)
Map(HashMap<String, Value, RandomState>)
Array(Vec<Value>)
Function(Function)
Number(Number)
Methods
impl Value
[src]
Trait Implementations
impl Clone for Value
[src]
fn clone(&self) -> Value
[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 From<u32> for Value
[src]
impl<T> From<Vec<T>> for Value where
T: Into<Value> + Clone,
[src]
T: Into<Value> + Clone,
fn from(f: Vec<T>) -> Value
[src]
Convert Vec to Value
Examples
use gtmpl_value::Value; let v = vec!(1, 2, 3); let x: Value = v.into();
impl<'a> From<Cow<'a, str>> for Value
[src]
fn from(f: Cow<'a, str>) -> Value
[src]
Convert CowValue
Examples
use gtmpl_value::Value; use std::borrow::Cow; let s: Cow<str> = Cow::Borrowed("foobar"); let x: Value = s.into();
impl From<i64> for Value
[src]
impl From<f32> for Value
[src]
impl<'a> From<&'a str> for Value
[src]
impl From<u16> for Value
[src]
impl From<u64> for Value
[src]
impl From<i8> for Value
[src]
impl<'a, T> From<&'a [T]> for Value where
T: Into<Value> + Clone,
[src]
T: Into<Value> + Clone,
fn from(f: &'a [T]) -> Value
[src]
Convert Slice to Value
Examples
use gtmpl_value::Value; let v: &[i32] = &[1, 2, 3]; let x: Value = v.into();
impl<T> From<HashMap<String, T, RandomState>> for Value where
T: Into<Value> + Clone,
[src]
T: Into<Value> + Clone,
fn from(f: HashMap<String, T, RandomState>) -> Value
[src]
Convert HashMapValue
Examples
use gtmpl_value::Value; use std::collections::HashMap; let mut m = HashMap::new(); m.insert("hello".to_owned(), 123); let x: Value = m.into();
impl From<u8> for Value
[src]
impl From<usize> for Value
[src]
impl From<fn(&[Arc<Any + 'static>]) -> Result<Arc<Any + 'static>, String>> for Value
[src]
fn from(
f: fn(&[Arc<Any + 'static>]) -> Result<Arc<Any + 'static>, String>
) -> Value
[src]
f: fn(&[Arc<Any + 'static>]) -> Result<Arc<Any + 'static>, String>
) -> Value
Convert Func to Value
Examples
use gtmpl_value::{Func, Value}; use std::any::Any; use std::sync::Arc; fn f(a: &[Arc<Any>]) -> Result<Arc<Any>, String> { Ok(a[0].clone()) }; let x: Value = (f as Func).into();
impl<'a> From<&'a String> for Value
[src]
fn from(s: &'a String) -> Value
[src]
Convert &String to Value
Examples
use gtmpl_value::Value; let s: &String = &"foobar".to_owned(); let x: Value = s.into();
impl From<i16> for Value
[src]
impl From<String> for Value
[src]
fn from(s: String) -> Value
[src]
Convert String to Value
Examples
use gtmpl_value::Value; let s: String = "foobar".to_owned(); let x: Value = s.into();
impl From<bool> for Value
[src]
impl From<f64> for Value
[src]
impl From<i32> for Value
[src]
impl From<isize> for Value
[src]
impl PartialEq<Value> for Value
[src]
fn eq(&self, __arg_0: &Value) -> 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) -> bool
[src]
This method tests for !=
.
impl Debug for Value
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.