pub enum Node {
Null,
Bool(bool),
Number(String),
String(String),
Array(Vec<Node>),
Object(Vec<(String, Node)>),
}Variants§
Null
Bool(bool)
Number(String)
The number literal.
String(String)
Array(Vec<Node>)
Object(Vec<(String, Node)>)
Implementations§
Source§impl Node
impl Node
pub fn is_null(&self) -> bool
Sourcepub fn member(&self, name: &str) -> Option<&Node>
pub fn member(&self, name: &str) -> Option<&Node>
The last member whose key matches name case-insensitively.
Sourcepub fn to_value(&self) -> Result<Value, DecodeError>
pub fn to_value(&self) -> Result<Value, DecodeError>
Go’s any view: numbers as float64, objects with the last duplicate winning.
Walks with an explicit stack, so the 10000 levels parse accepts cannot
overflow the thread stack.
Trait Implementations§
Source§impl Drop for Node
Frees nested containers with an explicit stack instead of the recursive
drop glue, which overflows the thread stack on deeply nested documents.
impl Drop for Node
Frees nested containers with an explicit stack instead of the recursive drop glue, which overflows the thread stack on deeply nested documents.
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl Forget for Node
impl Freeze for Node
impl Move for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnsafeUnpin for Node
impl UnwindSafe for Node
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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