pub struct PromptLayer {
pub template: Option<PromptTemplate>,
pub slots: HashMap<PromptSlot, PromptSlotLayer>,
}Fields§
§template: Option<PromptTemplate>§slots: HashMap<PromptSlot, PromptSlotLayer>Implementations§
Source§impl PromptLayer
impl PromptLayer
pub fn new() -> PromptLayer
pub fn is_empty(&self) -> bool
pub fn with_template(template: PromptTemplate) -> PromptLayer
pub fn prompt_template(self, template: PromptTemplate) -> PromptLayer
pub fn clear_template(self) -> PromptLayer
pub fn add_contribution(&mut self, contribution: PromptContribution)
pub fn with_contribution(self, contribution: PromptContribution) -> PromptLayer
pub fn replace_slot( &mut self, slot: PromptSlot, contributions: impl IntoIterator<Item = PromptContribution>, )
pub fn with_replaced_slot( self, slot: PromptSlot, contributions: impl IntoIterator<Item = PromptContribution>, ) -> PromptLayer
pub fn clear_slot(&mut self, slot: PromptSlot)
pub fn with_cleared_slot(self, slot: PromptSlot) -> PromptLayer
Trait Implementations§
Source§impl Clone for PromptLayer
impl Clone for PromptLayer
Source§fn clone(&self) -> PromptLayer
fn clone(&self) -> PromptLayer
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 moreSource§impl Debug for PromptLayer
impl Debug for PromptLayer
Source§impl Default for PromptLayer
impl Default for PromptLayer
Source§fn default() -> PromptLayer
fn default() -> PromptLayer
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PromptLayer
impl<'de> Deserialize<'de> for PromptLayer
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PromptLayer, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PromptLayer, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PromptLayer
impl PartialEq for PromptLayer
Source§fn eq(&self, other: &PromptLayer) -> bool
fn eq(&self, other: &PromptLayer) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PromptLayer
impl Serialize for PromptLayer
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for PromptLayer
impl StructuralPartialEq for PromptLayer
Auto Trait Implementations§
impl Freeze for PromptLayer
impl RefUnwindSafe for PromptLayer
impl Send for PromptLayer
impl Sync for PromptLayer
impl Unpin for PromptLayer
impl UnsafeUnpin for PromptLayer
impl UnwindSafe for PromptLayer
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