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§
Source§impl From<BigDecimal> for Value
impl From<BigDecimal> for Value
Source§fn from(bd: BigDecimal) -> Self
fn from(bd: BigDecimal) -> Self
Source§impl From<DateTime<FixedOffset>> for Value
impl From<DateTime<FixedOffset>> for Value
Source§fn from(date: DateTime<FixedOffset>) -> Self
fn from(date: DateTime<FixedOffset>) -> Self
Source§impl From<OrderedFloat<f64>> for Value
impl From<OrderedFloat<f64>> for Value
Source§fn from(of: OrderedFloat<f64>) -> Self
fn from(of: OrderedFloat<f64>) -> Self
Source§impl Ord for Value
impl Ord for Value
Source§impl PartialOrd for Value
impl PartialOrd for Value
impl Eq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more