Struct structured_output::StructuredOutput
source · 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<StructuredOutput> for StructuredOutput
impl PartialEq<StructuredOutput> for StructuredOutput
source§fn eq(&self, other: &StructuredOutput) -> bool
fn eq(&self, other: &StructuredOutput) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for StructuredOutput
Auto Trait Implementations§
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