Enum edn_format::Value
source · [−]pub enum Value {
Show 17 variants
Nil,
Boolean(bool),
Character(char),
String(String),
Symbol(Symbol),
Keyword(Keyword),
Integer(i64),
Float(OrderedFloat<f64>),
BigInt(BigInt),
BigDec(BigDecimal),
List(Vec<Value>),
Vector(Vec<Value>),
Map(BTreeMap<Value, Value>),
Set(BTreeSet<Value>),
Inst(DateTime<FixedOffset>),
Uuid(Uuid),
TaggedElement(Symbol, Box<Value>),
}Expand description
An EDN Value.
Variants
Nil
nil. Analogous to null, nothing, zip, zilch, and nada.
Boolean(bool)
A boolean value
Character(char)
A single character.
String(String)
A string. Used to represent textual data.
Symbol(Symbol)
A symbol. Used to represent identifiers.
Keyword(Keyword)
A keyword. An identifier that designates itself. For typical use, these should be used for keys in Value::Map instead of Value::String.
Integer(i64)
A signed integer
Float(OrderedFloat<f64>)
A floating point number with 64 bit precision.
BigInt(BigInt)
An integer with arbitrary precision
BigDec(BigDecimal)
A decimal number with exact precision
List(Vec<Value>)
A list of values.
Vector(Vec<Value>)
A vector of values. The major difference between this and a Value::List is that a vector is guaranteed by the spec to support random access of elements. In this implementation the semantic difference is maintained, but the underlying data structure for both is a Vec, which supports random access.
Map(BTreeMap<Value, Value>)
A collection of associations between keys and values. Supports any EDN value as a key. No semantics should be associated with the order in which the pairs appear.
Set(BTreeSet<Value>)
A collection of unique values. No semantics should be associated with the order the items appear.
Inst(DateTime<FixedOffset>)
An instant in time. Represented as a tagged element with tag inst and value
a RFC-3339 formatted string.
Uuid(Uuid)
A UUID. Represented as a tagged element with tag uuid and value
a canonical UUID string.
https://github.com/edn-format/edn#uuid-f81d4fae-7dec-11d0-a765-00a0c91e6bf6
TaggedElement(Symbol, Box<Value>)
A tagged element. This can be used to encode any kind of data as a distinct readable element, with semantics determined by the reader and writer.
Overriding the behavior of elements tagged with inst and uuid is not supported
in this implementation.
Trait Implementations
sourceimpl From<BigDecimal> for Value
impl From<BigDecimal> for Value
sourcefn from(bd: BigDecimal) -> Self
fn from(bd: BigDecimal) -> Self
Performs the conversion.
sourceimpl From<DateTime<FixedOffset>> for Value
impl From<DateTime<FixedOffset>> for Value
sourcefn from(date: DateTime<FixedOffset>) -> Self
fn from(date: DateTime<FixedOffset>) -> Self
Performs the conversion.
sourceimpl From<OrderedFloat<f64>> for Value
impl From<OrderedFloat<f64>> for Value
sourcefn from(of: OrderedFloat<f64>) -> Self
fn from(of: OrderedFloat<f64>) -> Self
Performs the conversion.
sourceimpl Ord for Value
impl Ord for Value
sourceimpl PartialOrd<Value> for Value
impl PartialOrd<Value> for Value
sourcefn partial_cmp(&self, other: &Value) -> Option<Ordering>
fn partial_cmp(&self, other: &Value) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Eq for Value
impl StructuralEq 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more