pub struct SnapcompactCompactor { /* private fields */ }Expand description
Bitmap-frame compactor that renders the discarded tail of a conversation as PNG frames via the snapcompact pipeline.
Unlike the LLM compactor, this compactor makes no LLM call — the local renderer is the only cost. Frames are addressed at vision-capable models (Anthropic, OpenAI, Google) that read the PNGs back directly.
§Limits
Snapcompact always returns real PNG bytes for each frame or
surfaces the failure via CompactionError::LlmError. There is no
“no-op renderer” fallback: a rendering failure becomes a
compaction failure (intentional, so the operator notices).
Implementations§
Source§impl SnapcompactCompactor
impl SnapcompactCompactor
Sourcepub fn with_shape(self, shape: Shape) -> Self
pub fn with_shape(self, shape: Shape) -> Self
Pin a specific shape (overrides model-aware resolution).
Sourcepub fn with_frame_chars(self, frame_chars: usize) -> Self
pub fn with_frame_chars(self, frame_chars: usize) -> Self
Set the per-frame source-text character limit.
Sourcepub fn with_max_frames(self, max_frames: u32) -> Self
pub fn with_max_frames(self, max_frames: u32) -> Self
Set the maximum number of frames per compaction.
Trait Implementations§
Source§impl Compactor for SnapcompactCompactor
impl Compactor for SnapcompactCompactor
Source§fn estimate_tokens(&self, messages: &[Message]) -> usize
fn estimate_tokens(&self, messages: &[Message]) -> usize
Estimate the token count of messages
Auto Trait Implementations§
impl Freeze for SnapcompactCompactor
impl RefUnwindSafe for SnapcompactCompactor
impl Send for SnapcompactCompactor
impl Sync for SnapcompactCompactor
impl Unpin for SnapcompactCompactor
impl UnsafeUnpin for SnapcompactCompactor
impl UnwindSafe for SnapcompactCompactor
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