[][src]Enum json_peek::value::Value

pub enum Value {
    Object(Object),
    Array(Array),
    Literal(Literal),
    Number(Number),
    Bool(Bool),
    Null(Null),
}

Variants

Object(Object)
Array(Array)
Literal(Literal)
Number(Number)
Bool(Bool)
Null(Null)

Methods

impl Value[src]

pub fn null() -> Value[src]

pub fn is_object(&self) -> bool[src]

pub fn is_array(&self) -> bool[src]

pub fn is_string(&self) -> bool[src]

pub fn is_number(&self) -> bool[src]

pub fn is_null(&self) -> bool[src]

pub fn is_bool(&self) -> bool[src]

pub fn span(&self) -> Span[src]

pub const fn some(self) -> Option<Self>[src]

Transform Value into Some(Value) of itself. This is helpful for testing since most of the operation return an Option<Value>

pub fn new_object(span: Span, value: HashMap<Literal, Value>) -> Value[src]

pub fn new_array(span: Span, value: Vec<Value>) -> Value[src]

pub fn new_string(span: Span, value: impl Into<String>) -> Value[src]

pub fn new_number(span: Span, value: impl Into<String>) -> Value[src]

pub fn new_null(span: Span) -> Value[src]

pub fn new_bool(span: Span, value: bool) -> Value[src]

pub fn test_object(value: HashMap<Literal, Value>) -> Value[src]

pub fn test_array(value: Vec<Value>) -> Value[src]

pub fn test_string(value: &str) -> Value[src]

pub fn test_number(value: &str) -> Value[src]

pub fn test_null() -> Value[src]

pub fn test_bool(value: bool) -> Value[src]

Trait Implementations

impl Clone for Value[src]

impl Debug for Value[src]

impl Eq for Value[src]

impl<'_> From<&'_ str> for Value[src]

impl<'a> Indexable<'a, usize> for Value[src]

type Output = Option<Value>

impl<'a, K> Keyable<'a, K> for Value where
    K: Into<Literal>, 
[src]

type Output = Option<Value>

impl<'_> PartialEq<&'_ str> for Value[src]

impl PartialEq<String> for Value[src]

impl PartialEq<Value> for Value[src]

impl PartialEq<str> for Value[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.