pub struct SectionBuilder { /* private fields */ }Expand description
Builder for creating prompt sections
Implementations§
Source§impl SectionBuilder
impl SectionBuilder
pub fn new() -> Self
Sourcepub fn add_static(self, name: impl Into<String>, content: &'static str) -> Self
pub fn add_static(self, name: impl Into<String>, content: &'static str) -> Self
Add a static section
Sourcepub fn add_dynamic<F>(self, name: impl Into<String>, compute: F) -> Self
pub fn add_dynamic<F>(self, name: impl Into<String>, compute: F) -> Self
Add a dynamic section
Sourcepub fn add_section(self, section: PromptSection) -> Self
pub fn add_section(self, section: PromptSection) -> Self
Add a section
Sourcepub fn build(self) -> Vec<PromptSection>
pub fn build(self) -> Vec<PromptSection>
Build sections sorted by order
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SectionBuilder
impl !RefUnwindSafe for SectionBuilder
impl Send for SectionBuilder
impl Sync for SectionBuilder
impl Unpin for SectionBuilder
impl UnsafeUnpin for SectionBuilder
impl !UnwindSafe for SectionBuilder
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