[−][src]Struct json_position_parser::tree::Tree
Fields
entries: Vec<Entry>
keys: Vec<Key>
Methods
impl Tree
[src]
pub fn value_at(&self, path: &[PathType]) -> Vec<&Entry>
[src]
Get values at a path. Wildcard and recursive wildcard available.
Example
let text = "{ \"a\": { \"b\": ["c"] } }"; match parse_json(&text) { Ok(tree) => { let keys = tree.values_at(&[ PathType::Object("a"), PathType::Object("b"), PathType::Array(0), ]); }, Err(e) => println!("{:?}", e), };
pub fn keys_at(&self, path: &[PathType]) -> Vec<&Key>
[src]
Get keys at a path. Wildcard and recursive wildcard available.
Example
let text = "{ \"a\": { \"b\": ["c"] } }"; match parse_json(&text) { Ok(tree) => { let keys = tree.keys_at(&[ PathType::Object("a"), PathType::Object("b"), PathType::Array(0), ]); }, Err(e) => println!("{:?}", e), };
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnwindSafe for Tree
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, 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>,