pub struct Fields<'a>(/* private fields */);Expand description
The fields of an object, searchable by name.
Implementations§
Source§impl<'a> Fields<'a>
impl<'a> Fields<'a>
pub fn parse(s: &'a str) -> Result<Self, JsonError>
Sourcepub fn string(&self, name: &str) -> Option<String>
pub fn string(&self, name: &str) -> Option<String>
The field as text, if it exists and is a string.
Sourcepub fn unsigned(&self, name: &str) -> Option<u64>
pub fn unsigned(&self, name: &str) -> Option<u64>
The field as an unsigned integer, if it exists and is such a number.
Sourcepub fn boolean(&self, name: &str) -> Option<bool>
pub fn boolean(&self, name: &str) -> Option<bool>
The field as a boolean, if it exists and is true or false.
pub fn names(&self) -> impl Iterator<Item = &str>
Auto Trait Implementations§
impl<'a> Freeze for Fields<'a>
impl<'a> RefUnwindSafe for Fields<'a>
impl<'a> Send for Fields<'a>
impl<'a> Sync for Fields<'a>
impl<'a> Unpin for Fields<'a>
impl<'a> UnsafeUnpin for Fields<'a>
impl<'a> UnwindSafe for Fields<'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