pub struct CacheAlignedOutput { /* private fields */ }Implementations§
Source§impl CacheAlignedOutput
impl CacheAlignedOutput
pub fn new() -> Self
pub fn add_stable_block(&mut self, id: &str, content: String, priority: u8)
pub fn add_variable_block(&mut self, id: &str, content: String, priority: u8)
Sourcepub fn render(&self) -> String
pub fn render(&self) -> String
Render the output with cache-optimal ordering: stable blocks first (sorted by priority), then variable blocks.
Sourcepub fn render_with_breakpoints(&self) -> (String, Vec<usize>)
pub fn render_with_breakpoints(&self) -> (String, Vec<usize>)
Render with explicit cache breakpoint markers for Claude. Places up to CLAUDE_MAX_CACHE_BREAKPOINTS markers at optimal positions.
pub fn stable_token_count(&self) -> usize
pub fn variable_token_count(&self) -> usize
pub fn cache_efficiency(&self) -> f64
Trait Implementations§
Source§impl Default for CacheAlignedOutput
impl Default for CacheAlignedOutput
Source§fn default() -> CacheAlignedOutput
fn default() -> CacheAlignedOutput
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CacheAlignedOutput
impl RefUnwindSafe for CacheAlignedOutput
impl Send for CacheAlignedOutput
impl Sync for CacheAlignedOutput
impl Unpin for CacheAlignedOutput
impl UnsafeUnpin for CacheAlignedOutput
impl UnwindSafe for CacheAlignedOutput
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