pub enum Value {
Show 15 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>),
}Expand description
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>)
Implementations§
Source§impl Value
impl Value
Sourcepub fn with_spans(self) -> ValueAndSpan
pub fn with_spans(self) -> ValueAndSpan
For debug use only!
But right now, it’s used in the bootstrapper. We’ll fix that soon.
Source§impl Value
impl Value
pub fn is_nil(&self) -> bool
pub fn is_boolean(&self) -> bool
pub fn is_integer(&self) -> bool
pub fn is_instant(&self) -> bool
pub fn is_big_integer(&self) -> bool
pub fn is_float(&self) -> bool
pub fn is_text(&self) -> bool
pub fn is_uuid(&self) -> bool
pub fn is_symbol(&self) -> bool
pub fn is_namespaced_symbol(&self) -> bool
pub fn is_vector(&self) -> bool
pub fn is_list(&self) -> bool
pub fn is_set(&self) -> bool
pub fn is_map(&self) -> bool
pub fn is_keyword(&self) -> bool
pub fn is_namespaced_keyword(&self) -> bool
Sourcepub fn as_nil(&self) -> Option<()>
pub fn as_nil(&self) -> Option<()>
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>
pub fn as_integer(&self) -> Option<i64>
pub fn as_instant(&self) -> Option<DateTime<Utc>>
pub fn as_float(&self) -> Option<f64>
pub fn as_big_integer(&self) -> Option<&BigInt>
pub fn as_ordered_float(&self) -> Option<&OrderedFloat<f64>>
pub fn as_text(&self) -> Option<&String>
pub fn as_uuid(&self) -> Option<&Uuid>
pub fn as_symbol(&self) -> Option<&PlainSymbol>
pub fn as_namespaced_symbol(&self) -> Option<&NamespacedSymbol>
pub fn as_keyword(&self) -> Option<&Keyword>
pub fn as_plain_keyword(&self) -> Option<&Keyword>
pub fn as_namespaced_keyword(&self) -> Option<&Keyword>
pub fn as_vector(&self) -> Option<&Vec<Value>>
pub fn as_list(&self) -> Option<&LinkedList<Value>>
pub fn as_set(&self) -> Option<&BTreeSet<Value>>
pub fn as_map(&self) -> Option<&BTreeMap<Value, Value>>
pub fn into_boolean(self) -> Option<bool>
pub fn into_integer(self) -> Option<i64>
pub fn into_instant(self) -> Option<DateTime<Utc>>
pub fn into_big_integer(self) -> Option<BigInt>
pub fn into_ordered_float(self) -> Option<OrderedFloat<f64>>
pub fn into_float(self) -> Option<f64>
pub fn into_text(self) -> Option<String>
pub fn into_uuid(self) -> Option<Uuid>
pub fn into_symbol(self) -> Option<PlainSymbol>
pub fn into_namespaced_symbol(self) -> Option<NamespacedSymbol>
pub fn into_keyword(self) -> Option<Keyword>
pub fn into_plain_keyword(self) -> Option<Keyword>
pub fn into_namespaced_keyword(self) -> Option<Keyword>
pub fn into_vector(self) -> Option<Vec<Value>>
pub fn into_list(self) -> Option<LinkedList<Value>>
pub fn into_set(self) -> Option<BTreeSet<Value>>
pub fn into_map(self) -> Option<BTreeMap<Value, Value>>
pub fn from_bigint(src: &str) -> Option<Value>
pub fn from_float(src: f64) -> Value
pub fn from_ordered_float(src: OrderedFloat<f64>) -> Value
pub fn from_symbol<'a, T: Into<Option<&'a str>>>( namespace: T, name: &str, ) -> Value
pub fn from_keyword<'a, T: Into<Option<&'a str>>>( namespace: T, name: &str, ) -> Value
pub fn is_collection(&self) -> bool
pub fn is_atom(&self) -> bool
pub fn into_atom(self) -> Option<Value>
Trait Implementations§
impl Eq for Value
Source§impl From<SpannedValue> for Value
impl From<SpannedValue> for Value
Source§fn from(src: SpannedValue) -> Value
fn from(src: SpannedValue) -> Value
Converts to this type from the input type.
Source§impl From<ValueAndSpan> for Value
impl From<ValueAndSpan> for Value
Source§fn from(src: ValueAndSpan) -> Value
fn from(src: ValueAndSpan) -> Value
Converts to this type from the input type.
Source§impl Ord for Value
impl Ord for Value
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Value
impl PartialOrd for Value
impl StructuralPartialEq 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 UnsafeUnpin 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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