Enum edn::types::Value
[−]
[src]
pub enum Value { Nil, Boolean(bool), Integer(i64), Instant(DateTime<Utc>), BigInteger(BigInt), Float(OrderedFloat<f64>), Text(String), Uuid(Uuid), PlainSymbol(PlainSymbol), NamespacedSymbol(NamespacedSymbol), Keyword(Keyword), Vector(Vec<Value>), List(LinkedList<Value>), Set(BTreeSet<Value>), Map(BTreeMap<Value, Value>), }
Value represents one of the allowed values in an EDN string.
Variants
Nil
Boolean(bool)
Integer(i64)
Instant(DateTime<Utc>)
BigInteger(BigInt)
Float(OrderedFloat<f64>)
Text(String)
Uuid(Uuid)
PlainSymbol(PlainSymbol)
NamespacedSymbol(NamespacedSymbol)
Keyword(Keyword)
Vector(Vec<Value>)
List(LinkedList<Value>)
Set(BTreeSet<Value>)
Map(BTreeMap<Value, Value>)
Methods
impl Value
[src]
pub fn with_spans(self) -> ValueAndSpan
[src]
For debug use only!
But right now, it's used in the bootstrapper. We'll fix that soon.
impl Value
[src]
pub fn is_nil(&self) -> bool
[src]
pub fn is_boolean(&self) -> bool
[src]
pub fn is_integer(&self) -> bool
[src]
pub fn is_instant(&self) -> bool
[src]
pub fn is_big_integer(&self) -> bool
[src]
pub fn is_float(&self) -> bool
[src]
pub fn is_text(&self) -> bool
[src]
pub fn is_uuid(&self) -> bool
[src]
pub fn is_symbol(&self) -> bool
[src]
pub fn is_namespaced_symbol(&self) -> bool
[src]
pub fn is_vector(&self) -> bool
[src]
pub fn is_list(&self) -> bool
[src]
pub fn is_set(&self) -> bool
[src]
pub fn is_map(&self) -> bool
[src]
pub fn is_keyword(&self) -> bool
[src]
pub fn is_namespaced_keyword(&self) -> bool
[src]
pub fn as_nil(&self) -> Option<()>
[src]
as_nil
does not use the macro as it does not have an underlying
value, and returns Option<()>
.
pub fn as_boolean(&self) -> Option<bool>
[src]
pub fn as_integer(&self) -> Option<i64>
[src]
pub fn as_instant(&self) -> Option<DateTime<Utc>>
[src]
pub fn as_float(&self) -> Option<f64>
[src]
pub fn as_big_integer(&self) -> Option<&BigInt>
[src]
pub fn as_ordered_float(&self) -> Option<&OrderedFloat<f64>>
[src]
pub fn as_text(&self) -> Option<&String>
[src]
pub fn as_uuid(&self) -> Option<&Uuid>
[src]
pub fn as_symbol(&self) -> Option<&PlainSymbol>
[src]
pub fn as_namespaced_symbol(&self) -> Option<&NamespacedSymbol>
[src]
pub fn as_keyword(&self) -> Option<&Keyword>
[src]
pub fn as_plain_keyword(&self) -> Option<&Keyword>
[src]
pub fn as_namespaced_keyword(&self) -> Option<&Keyword>
[src]
pub fn as_vector(&self) -> Option<&Vec<Value>>
[src]
pub fn as_list(&self) -> Option<&LinkedList<Value>>
[src]
pub fn as_set(&self) -> Option<&BTreeSet<Value>>
[src]
pub fn as_map(&self) -> Option<&BTreeMap<Value, Value>>
[src]
pub fn into_boolean(self) -> Option<bool>
[src]
pub fn into_integer(self) -> Option<i64>
[src]
pub fn into_instant(self) -> Option<DateTime<Utc>>
[src]
pub fn into_big_integer(self) -> Option<BigInt>
[src]
pub fn into_ordered_float(self) -> Option<OrderedFloat<f64>>
[src]
pub fn into_float(self) -> Option<f64>
[src]
pub fn into_text(self) -> Option<String>
[src]
pub fn into_uuid(self) -> Option<Uuid>
[src]
pub fn into_symbol(self) -> Option<PlainSymbol>
[src]
pub fn into_namespaced_symbol(self) -> Option<NamespacedSymbol>
[src]
pub fn into_keyword(self) -> Option<Keyword>
[src]
pub fn into_plain_keyword(self) -> Option<Keyword>
[src]
pub fn into_namespaced_keyword(self) -> Option<Keyword>
[src]
pub fn into_vector(self) -> Option<Vec<Value>>
[src]
pub fn into_list(self) -> Option<LinkedList<Value>>
[src]
pub fn into_set(self) -> Option<BTreeSet<Value>>
[src]
pub fn into_map(self) -> Option<BTreeMap<Value, Value>>
[src]
pub fn from_bigint(src: &str) -> Option<Value>
[src]
pub fn from_float(src: f64) -> Value
[src]
pub fn from_ordered_float(src: OrderedFloat<f64>) -> Value
[src]
pub fn from_symbol<'a, T: Into<Option<&'a str>>>(
namespace: T,
name: &str
) -> Value
[src]
namespace: T,
name: &str
) -> Value
pub fn from_keyword<'a, T: Into<Option<&'a str>>>(
namespace: T,
name: &str
) -> Value
[src]
namespace: T,
name: &str
) -> Value
pub fn is_collection(&self) -> bool
[src]
pub fn is_atom(&self) -> bool
[src]
pub fn into_atom(self) -> Option<Value>
[src]
impl Value
[src]
pub fn to_pretty(&self, width: usize) -> Result<String, Error>
[src]
Return a pretty string representation of this Value
.
impl Value
[src]
pub fn matches(&self, pattern: &Value) -> bool
[src]
Performs default pattern matching between this value and some pattern
.
Returns true if matching succeeds.
Trait Implementations
impl PartialEq 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 Eq for Value
[src]
impl Hash for Value
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
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 Debug for Value
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl From<SpannedValue> for Value
[src]
fn from(src: SpannedValue) -> Value
[src]
Performs the conversion.
impl From<ValueAndSpan> for Value
[src]
fn from(src: ValueAndSpan) -> Value
[src]
Performs the conversion.
impl PartialOrd for Value
[src]
fn partial_cmp(&self, other: &Value) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for Value
[src]
fn cmp(&self, other: &Value) -> 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