pub enum Read {
Null,
Bool(bool),
Number(String),
Text(String),
Array(Vec<Read>),
Object(BTreeMap<String, Read>),
}Expand description
A value of a document, read.
Variants§
Null
The null of the format.
Bool(bool)
A truth value.
Number(String)
A number, kept as the text of it: the format has no limit on the digits, and a report asks a number for what it is and not for how it is spelled.
Text(String)
A text.
Array(Vec<Read>)
An array.
Object(BTreeMap<String, Read>)
An object, in the order of the names it arrived in.
Implementations§
Source§impl Read
impl Read
Sourcepub fn get(&self, name: &str) -> Option<&Read>
pub fn get(&self, name: &str) -> Option<&Read>
The value under a name, when this one is an object that has it.
Sourcepub fn at(&self, place: usize) -> Option<&Read>
pub fn at(&self, place: usize) -> Option<&Read>
The value at a place, when this one is an array that has it.
Sourcepub fn names(&self) -> Vec<&str>
pub fn names(&self) -> Vec<&str>
The names of the members of an object, in the order of the document.
Sourcepub fn field_text(&self, name: &str) -> Option<&str>
pub fn field_text(&self, name: &str) -> Option<&str>
The text under a name, when the member is a text.
Trait Implementations§
impl StructuralPartialEq for Read
Auto Trait Implementations§
impl Forget for Read
impl Freeze for Read
impl RefUnwindSafe for Read
impl Send for Read
impl Sync for Read
impl Unpin for Read
impl UnsafeUnpin for Read
impl UnwindSafe for Read
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