Struct jsonpath_rust::JsonPathFinder
source · pub struct JsonPathFinder { /* private fields */ }
Expand description
The base structure stitching the json instance and jsonpath instance
Implementations§
source§impl JsonPathFinder
impl JsonPathFinder
sourcepub fn new(json: Box<Value>, path: Box<JsonPathInst>) -> Self
pub fn new(json: Box<Value>, path: Box<JsonPathInst>) -> Self
creates a new instance of JsonPathFinder
sourcepub fn set_path(&mut self, path: Box<JsonPathInst>)
pub fn set_path(&mut self, path: Box<JsonPathInst>)
updates a path with a new one
sourcepub fn set_json_str(&mut self, json: &str) -> Result<(), String>
pub fn set_json_str(&mut self, json: &str) -> Result<(), String>
updates a json from string and therefore can be some parsing errors
sourcepub fn set_path_str(&mut self, path: &str) -> Result<(), String>
pub fn set_path_str(&mut self, path: &str) -> Result<(), String>
updates a path from string and therefore can be some parsing errors
sourcepub fn from_str(json: &str, path: &str) -> Result<Self, String>
pub fn from_str(json: &str, path: &str) -> Result<Self, String>
create a new instance from string and therefore can be some parsing errors
sourcepub fn instance(&self) -> PathInstance<'_>
pub fn instance(&self) -> PathInstance<'_>
creates an instance to find a json slice from the json
sourcepub fn find_slice(&self) -> Vec<JsonPathValue<'_, Value>>
pub fn find_slice(&self) -> Vec<JsonPathValue<'_, Value>>
finds a slice of data in the set json. The result is a vector of references to the incoming structure.