pub struct PathMapper;Expand description
Path mapper for extracting and setting values in JSON using dot-notation paths
Implementations§
Source§impl PathMapper
impl PathMapper
Sourcepub fn get_path<'a>(obj: &'a Value, path: &str) -> Option<&'a Value>
pub fn get_path<'a>(obj: &'a Value, path: &str) -> Option<&'a Value>
Get value from JSON using dot-notation path (supports array indexing)
Examples:
- “choices[0].delta.content”
- “input.temperature”
- “delta.text”
Sourcepub fn get_string(obj: &Value, path: &str) -> Option<String>
pub fn get_string(obj: &Value, path: &str) -> Option<String>
Get string value from path (converts number to string if needed)
Auto Trait Implementations§
impl Freeze for PathMapper
impl RefUnwindSafe for PathMapper
impl Send for PathMapper
impl Sync for PathMapper
impl Unpin for PathMapper
impl UnwindSafe for PathMapper
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