pub struct ParsedPrompt { /* private fields */ }Implementations§
Source§impl ParsedPrompt
impl ParsedPrompt
Sourcepub fn parse(source: &str) -> Result<Self, String>
pub fn parse(source: &str) -> Result<Self, String>
Parse a prompt template. Validates that all <field> placeholders
are known prompt fields. Returns the parse error on failure.
Sourcepub fn render(&self, ctx: &PromptContext) -> String
pub fn render(&self, ctx: &PromptContext) -> String
Render the prompt against a context. Missing fields render as empty.
pub fn source(&self) -> &str
Trait Implementations§
Source§impl Clone for ParsedPrompt
impl Clone for ParsedPrompt
Source§fn clone(&self) -> ParsedPrompt
fn clone(&self) -> ParsedPrompt
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParsedPrompt
impl RefUnwindSafe for ParsedPrompt
impl Send for ParsedPrompt
impl Sync for ParsedPrompt
impl Unpin for ParsedPrompt
impl UnsafeUnpin for ParsedPrompt
impl UnwindSafe for ParsedPrompt
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