pub trait PromptMessageExt:
Send
+ Sync
+ Clone
+ Serialize
+ for<'de> Deserialize<'de>
+ PartialEq {
// Required methods
fn bind(&self, name: &str, value: &str) -> Result<Self, TypeError>
where Self: Sized;
fn bind_mut(&mut self, name: &str, value: &str) -> Result<(), TypeError>;
fn extract_variables(&self) -> Vec<String>;
fn from_text(content: String, role: &str) -> Result<Self, TypeError>;
}Expand description
Core trait that all message types must implement
Required Methods§
Sourcefn bind(&self, name: &str, value: &str) -> Result<Self, TypeError>where
Self: Sized,
fn bind(&self, name: &str, value: &str) -> Result<Self, TypeError>where
Self: Sized,
Bind a variable in the message content, returning a new instance
Sourcefn bind_mut(&mut self, name: &str, value: &str) -> Result<(), TypeError>
fn bind_mut(&mut self, name: &str, value: &str) -> Result<(), TypeError>
Bind a variable in-place
Sourcefn extract_variables(&self) -> Vec<String>
fn extract_variables(&self) -> Vec<String>
Extract variables from the message content
fn from_text(content: String, role: &str) -> Result<Self, TypeError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.