pub struct JsonOutputParser;Expand description
Parser that deserialises JSON text to serde_json::Value.
Useful when you need structured data from a model but do not have a specific Rust type to deserialise into.
§Examples
use synwire_core::output_parsers::{OutputParser, JsonOutputParser};
let parser = JsonOutputParser;
let result = parser.parse(r#"{"key": "value"}"#).unwrap();
assert_eq!(result["key"], "value");Trait Implementations§
Source§impl OutputParser for JsonOutputParser
impl OutputParser for JsonOutputParser
Auto Trait Implementations§
impl Freeze for JsonOutputParser
impl RefUnwindSafe for JsonOutputParser
impl Send for JsonOutputParser
impl Sync for JsonOutputParser
impl Unpin for JsonOutputParser
impl UnsafeUnpin for JsonOutputParser
impl UnwindSafe for JsonOutputParser
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