pub struct ContextSection {
pub id: CompactString,
pub partition: ContextSectionPartition,
pub priority: i16,
pub cache_policy: SectionCachePolicy,
pub invalidation: SectionInvalidation,
pub token_budget: Option<u32>,
pub enabled: bool,
pub is_pinned: bool,
}Expand description
One context section declaration.
Fields§
§id: CompactString§partition: ContextSectionPartition§priority: i16Higher priority sections are rendered earlier.
cache_policy: SectionCachePolicy§invalidation: SectionInvalidation§token_budget: Option<u32>§enabled: bool§is_pinned: boolPinned sections are exempt from GC/compression even under token pressure.
Implementations§
Source§impl ContextSection
impl ContextSection
pub fn new( id: impl Into<CompactString>, partition: ContextSectionPartition, priority: i16, ) -> Self
pub fn pinned(self) -> Self
pub fn with_cache_policy(self, policy: SectionCachePolicy) -> Self
pub fn with_invalidation(self, invalidation: SectionInvalidation) -> Self
pub fn with_token_budget(self, token_budget: u32) -> Self
pub fn disabled(self) -> Self
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 (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 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
Auto Trait Implementations§
impl Freeze for ContextSection
impl RefUnwindSafe for ContextSection
impl Send for ContextSection
impl Sync for ContextSection
impl Unpin for ContextSection
impl UnsafeUnpin 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