pub struct HookSessionReducer { /* private fields */ }Expand description
Stateful, pure hook event reducer.
It owns only protocol state: source ordering, bounded event-ID replay protection, and tool start/completion correlation. It does not own hook installation, authentication, transport, persistence, or presentation.
Implementations§
Source§impl HookSessionReducer
impl HookSessionReducer
pub fn new(adapter_id: AdapterId) -> Self
pub fn adapter_id(&self) -> &AdapterId
pub fn last_source_sequence(&self) -> u64
Sourcepub fn seed_live_subagents(&mut self, seeds: &[HookSubagentSeed]) -> usize
pub fn seed_live_subagents(&mut self, seeds: &[HookSubagentSeed]) -> usize
Seeds a persisted working-child snapshot before live Hook traffic.
Only Claude currently consumes these seeds. They remain provisional:
a later complete background_tasks inventory may reap a child whose
finish hook arrived while the listener was offline.
pub fn reduce( &mut self, envelope: HookEventEnvelope, ) -> Result<HookReduction, HookSessionReducerError>
pub fn clear_protocol_state(&mut self)
Trait Implementations§
Source§impl Clone for HookSessionReducer
impl Clone for HookSessionReducer
Auto Trait Implementations§
impl Freeze for HookSessionReducer
impl RefUnwindSafe for HookSessionReducer
impl Send for HookSessionReducer
impl Sync for HookSessionReducer
impl Unpin for HookSessionReducer
impl UnsafeUnpin for HookSessionReducer
impl UnwindSafe for HookSessionReducer
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