pub struct Format { /* private fields */ }Expand description
Formatting instruction stored as Value::Format.
Parsed from "Instruction" <template> "Example1", ... and rendered by
Writer helpers for prompts or output schemas.
Implementations§
Source§impl Format
impl Format
Sourcepub fn as_value(
instruction: Arc<str>,
template: Arc<str>,
examples: Arc<Vec<Arc<str>>>,
) -> Value
pub fn as_value( instruction: Arc<str>, template: Arc<str>, examples: Arc<Vec<Arc<str>>>, ) -> Value
Constructs a new Value::Format from components.
Sourcepub fn instruction(&self) -> Arc<str>
pub fn instruction(&self) -> Arc<str>
Instruction text.
Sourcepub fn to_formula(&self) -> String
pub fn to_formula(&self) -> String
Return the formula-string representation (round-trippable by the parser).
Trait Implementations§
Source§impl WriterLike for Format
impl WriterLike for Format
Source§fn to_stringized(&self) -> String
fn to_stringized(&self) -> String
Return a string representation (raw unsafe output).
Source§fn to_sanitized(&self) -> String
fn to_sanitized(&self) -> String
Return a sanitized string representation (escaped for safe output).
Source§fn to_expressionized(&self) -> String
fn to_expressionized(&self) -> String
Return a sanitized string representation (escaped for safe output).
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnwindSafe for Format
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.