pub enum Value<'a> {
StringLit(StringLit<'a>),
NumberLit(NumberLit<'a>),
BooleanLit(BooleanLit),
Object(Object<'a>),
Array(Array<'a>),
NullKeyword(NullKeyword),
}
Expand description
JSON value.
Variants§
StringLit(StringLit<'a>)
NumberLit(NumberLit<'a>)
BooleanLit(BooleanLit)
Object(Object<'a>)
Array(Array<'a>)
NullKeyword(NullKeyword)
Implementations§
Source§impl<'a> Value<'a>
impl<'a> Value<'a>
pub fn as_string_lit(&self) -> Option<&StringLit<'a>>
pub fn as_number_lit(&self) -> Option<&NumberLit<'a>>
pub fn as_boolean_lit(&self) -> Option<&BooleanLit>
pub fn as_object(&self) -> Option<&Object<'a>>
pub fn as_array(&self) -> Option<&Array<'a>>
pub fn as_null_keyword(&self) -> Option<&NullKeyword>
Trait Implementations§
impl<'a> StructuralPartialEq for Value<'a>
Auto Trait Implementations§
impl<'a> Freeze for Value<'a>
impl<'a> RefUnwindSafe for Value<'a>
impl<'a> Send for Value<'a>
impl<'a> Sync for Value<'a>
impl<'a> Unpin for Value<'a>
impl<'a> UnwindSafe for Value<'a>
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)