pub struct ContextSection {
pub section_id: Uuid,
pub section_type: SectionType,
pub content: String,
pub token_count: i32,
pub priority: i32,
pub compressible: bool,
pub sources: Vec<SourceRef>,
}Expand description
A section of the assembled context.
Fields§
§section_id: UuidUnique identifier for this section
section_type: SectionTypeType of this section
content: StringContent of this section
token_count: i32Token count for this section
priority: i32Priority (higher = more important)
compressible: boolWhether this section can be compressed
sources: Vec<SourceRef>Sources that contributed to this section
Implementations§
Source§impl ContextSection
impl ContextSection
Sourcepub fn new(section_type: SectionType, content: String, priority: i32) -> Self
pub fn new(section_type: SectionType, content: String, priority: i32) -> Self
Create a new context section.
Sourcepub fn with_compressible(self, compressible: bool) -> Self
pub fn with_compressible(self, compressible: bool) -> Self
Set whether this section is compressible.
Sourcepub fn with_sources(self, sources: Vec<SourceRef>) -> Self
pub fn with_sources(self, sources: Vec<SourceRef>) -> Self
Add source references.
Trait Implementations§
Source§impl Clone for ContextSection
impl Clone for ContextSection
Source§fn clone(&self) -> ContextSection
fn clone(&self) -> ContextSection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ComposeSchema for ContextSection
impl ComposeSchema for ContextSection
Source§impl Debug for ContextSection
impl Debug for ContextSection
Source§impl<'de> Deserialize<'de> for ContextSection
impl<'de> Deserialize<'de> for ContextSection
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
Source§impl PartialEq for ContextSection
impl PartialEq for ContextSection
Source§impl Serialize for ContextSection
impl Serialize for ContextSection
Source§impl ToSchema for ContextSection
impl ToSchema for ContextSection
impl StructuralPartialEq for ContextSection
Auto Trait Implementations§
impl Freeze for ContextSection
impl RefUnwindSafe for ContextSection
impl Send for ContextSection
impl Sync for ContextSection
impl Unpin for ContextSection
impl UnwindSafe for ContextSection
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