pub struct PromptModule { /* private fields */ }Expand description
Ordered prompt fragments contributed at one authority and priority.
Implementations§
Source§impl PromptModule
impl PromptModule
Sourcepub fn new(
id: PromptModuleId,
authority: PromptAuthority,
priority: PromptPriority,
segments: Vec<PromptSegment>,
) -> Result<Self, ModuleError>
pub fn new( id: PromptModuleId, authority: PromptAuthority, priority: PromptPriority, segments: Vec<PromptSegment>, ) -> Result<Self, ModuleError>
Creates a validated non-empty prompt module.
§Errors
Returns an error for an empty/oversized collection or duplicate segment IDs.
Sourcepub const fn id(&self) -> &PromptModuleId
pub const fn id(&self) -> &PromptModuleId
Returns module identity.
Returns fixed authority.
Sourcepub const fn priority(&self) -> PromptPriority
pub const fn priority(&self) -> PromptPriority
Returns within-authority priority.
Sourcepub fn segments(&self) -> &[PromptSegment]
pub fn segments(&self) -> &[PromptSegment]
Returns source-ordered segments.
Trait Implementations§
Source§impl Clone for PromptModule
impl Clone for PromptModule
Source§fn clone(&self) -> PromptModule
fn clone(&self) -> PromptModule
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 PromptModule
impl Debug for PromptModule
Source§impl<'de> Deserialize<'de> for PromptModule
impl<'de> Deserialize<'de> for PromptModule
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PromptModule
Source§impl PartialEq for PromptModule
impl PartialEq for PromptModule
Source§impl Serialize for PromptModule
impl Serialize for PromptModule
impl StructuralPartialEq for PromptModule
Auto Trait Implementations§
impl Freeze for PromptModule
impl RefUnwindSafe for PromptModule
impl Send for PromptModule
impl Sync for PromptModule
impl Unpin for PromptModule
impl UnsafeUnpin for PromptModule
impl UnwindSafe for PromptModule
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