Enum json_syntax::Value
source · [−]pub enum Value<S, P = Span> {
Null,
Boolean(bool),
Number(NumberBuf),
String(String),
Array(Array<S, P>),
Object(Object<S, P>),
}
Expand description
Value.
Variants
Null
null
.
Boolean(bool)
Boolean true
or false
.
Number(NumberBuf)
Number.
String(String)
String.
Array(Array<S, P>)
Array.
Object(Object<S, P>)
Object.
Implementations
sourceimpl<S, P> Value<S, P>
impl<S, P> Value<S, P>
pub fn is_null(&self) -> bool
pub fn is_boolean(&self) -> bool
pub fn is_number(&self) -> bool
pub fn is_string(&self) -> bool
pub fn is_array(&self) -> bool
pub fn is_object(&self) -> bool
pub fn as_boolean(&self) -> Option<bool>
pub fn as_boolean_mut(&mut self) -> Option<&mut bool>
pub fn as_number(&self) -> Option<&Number>
pub fn as_number_mut(&mut self) -> Option<&mut NumberBuf>
pub fn as_string(&self) -> Option<&str>
pub fn as_string_mut(&mut self) -> Option<&mut String>
pub fn as_array(&self) -> Option<&[Loc<Self, S, P>]>
pub fn as_array_mut(&mut self) -> Option<&mut Array<S, P>>
pub fn as_object(&self) -> Option<&Object<S, P>>
pub fn as_object_mut(&mut self) -> Option<&mut Object<S, P>>
Trait Implementations
sourceimpl<F: Clone> Parse<F> for Value<F>
impl<F: Clone> Parse<F> for Value<F>
fn parse_in<E, C>(
parser: &mut Parser<F, E, C>,
context: Context
) -> Result<Loc<Self, F>, Loc<Error<E, F>, F>> where
C: Iterator<Item = Result<DecodedChar, E>>,
fn parse<E, C>(file: F, chars: C) -> Result<Loc<Self, F>, Loc<Error<E, F>, F>> where
C: Iterator<Item = Result<DecodedChar, E>>,
fn parse_with<E, C>(
file: F,
chars: C,
options: Options
) -> Result<Loc<Self, F>, Loc<Error<E, F>, F>> where
C: Iterator<Item = Result<DecodedChar, E>>,
Auto Trait Implementations
impl<S, P> RefUnwindSafe for Value<S, P> where
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, P> Send for Value<S, P> where
P: Send,
S: Send,
impl<S, P> Sync for Value<S, P> where
P: Sync,
S: Sync,
impl<S, P> Unpin for Value<S, P> where
P: Unpin,
S: Unpin,
impl<S, P> UnwindSafe for Value<S, P> where
P: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more