[−][src]Struct jsonc_parser::ast::Object
Represents an object that may contain properties (ex. {}
, { "prop": 4 }
).
Fields
range: Range
properties: Vec<ObjectProp>
Implementations
impl Object
[src]
pub fn get(&self, name: &str) -> Option<&ObjectProp>
[src]
Gets a property value in the object by its name.
pub fn get_string(&self, name: &str) -> Option<&StringLit>
[src]
Gets a string property value from the object by name.
Returns None
when not a string or it doesn't exist.
pub fn get_number(&self, name: &str) -> Option<&NumberLit>
[src]
Gets a number property value from the object by name.
Returns None
when not a number or it doesn't exist.
pub fn get_boolean(&self, name: &str) -> Option<&BooleanLit>
[src]
Gets a boolean property value from the object by name.
Returns None
when not a boolean or it doesn't exist.
pub fn get_object(&self, name: &str) -> Option<&Object>
[src]
Gets an object property value from the object by name.
Returns None
when not an object or it doesn't exist.
pub fn get_array(&self, name: &str) -> Option<&Array>
[src]
Gets an array property value from the object by name.
Returns None
when not an array or it doesn't exist.
pub fn take(&mut self, name: &str) -> Option<ObjectProp>
[src]
Takes a value from the object by name.
Returns None
when it doesn't exist.
pub fn take_string(&mut self, name: &str) -> Option<StringLit>
[src]
Takes a string property value from the object by name.
Returns None
when not a string or it doesn't exist.
pub fn take_number(&mut self, name: &str) -> Option<NumberLit>
[src]
Takes a number property value from the object by name.
Returns None
when not a number or it doesn't exist.
pub fn take_boolean(&mut self, name: &str) -> Option<BooleanLit>
[src]
Takes a boolean property value from the object by name.
Returns None
when not a boolean or it doesn't exist.
pub fn take_object(&mut self, name: &str) -> Option<Object>
[src]
Takes an object property value from the object by name.
Returns None
when not an object or it doesn't exist.
pub fn take_array(&mut self, name: &str) -> Option<Array>
[src]
Takes an array property value from the object by name.
Returns None
when not an array or it doesn't exist.
Trait Implementations
impl Clone for Object
[src]
impl Debug for Object
[src]
impl<'a> From<&'a Object> for Node<'a>
[src]
impl PartialEq<Object> for Object
[src]
impl Ranged for Object
[src]
fn range(&self) -> &Range
[src]
fn start(&self) -> usize
[src]
fn start_line(&self) -> usize
[src]
fn end(&self) -> usize
[src]
fn end_line(&self) -> usize
[src]
fn text<'a>(&self, text: &'a str) -> &'a str
[src]
fn start_position(&self) -> Position
[src]
fn end_position(&self) -> Position
[src]
fn width(&self) -> usize
[src]
impl StructuralPartialEq for Object
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Object
impl !Send for Object
impl !Sync for Object
impl Unpin for Object
impl UnwindSafe for Object
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,