pub struct StructuredOutput {
pub lines: String,
pub json: Value,
}
Expand description
A struct that contains both a string and a json value.
Fields§
§lines: String
§json: Value
Implementations§
Source§impl StructuredOutput
impl StructuredOutput
Sourcepub fn new(lines: impl Into<String>, json: impl Into<Value>) -> StructuredOutput
pub fn new(lines: impl Into<String>, json: impl Into<Value>) -> StructuredOutput
Create a new StructuredOutput that includes both a string and a json value.
Sourcepub fn to_json_string(&self) -> String
pub fn to_json_string(&self) -> String
Get the json value of the output as a JSON string.
Sourcepub fn to_json_pretty(&self) -> String
pub fn to_json_pretty(&self) -> String
Get the json value of the output as a prettified JSON string.
Trait Implementations§
Source§impl Clone for StructuredOutput
impl Clone for StructuredOutput
Source§fn clone(&self) -> StructuredOutput
fn clone(&self) -> StructuredOutput
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for StructuredOutput
impl Debug for StructuredOutput
Source§impl Default for StructuredOutput
impl Default for StructuredOutput
Source§fn default() -> StructuredOutput
fn default() -> StructuredOutput
Returns the “default value” for a type. Read more
Source§impl Display for StructuredOutput
impl Display for StructuredOutput
Source§impl PartialEq for StructuredOutput
impl PartialEq for StructuredOutput
impl StructuralPartialEq for StructuredOutput
Auto Trait Implementations§
impl Freeze for StructuredOutput
impl RefUnwindSafe for StructuredOutput
impl Send for StructuredOutput
impl Sync for StructuredOutput
impl Unpin for StructuredOutput
impl UnwindSafe for StructuredOutput
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