pub struct InMemoryToolEventRecorder { /* private fields */ }Expand description
Bounded in-memory recorder for tests and embedders.
Both publication and observation use Mutex::try_lock; contention is a
drop/error signal and can never park the executing tool thread.
Implementations§
Source§impl InMemoryToolEventRecorder
impl InMemoryToolEventRecorder
pub fn new(capacity: usize) -> Result<Self, ToolEventPublishError>
pub fn try_snapshot(&self) -> Result<Vec<ToolEventV1>, ToolEventPublishError>
pub fn try_drain(&self) -> Result<Vec<ToolEventV1>, ToolEventPublishError>
Trait Implementations§
Source§impl Debug for InMemoryToolEventRecorder
impl Debug for InMemoryToolEventRecorder
Source§impl ToolEventPublisher for InMemoryToolEventRecorder
impl ToolEventPublisher for InMemoryToolEventRecorder
fn try_publish(&self, event: ToolEventV1) -> Result<(), ToolEventPublishError>
Source§fn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Fast capability hint so the default no-op path performs no event DTO
allocation. Implementations should keep the default
true.Auto Trait Implementations§
impl !Freeze for InMemoryToolEventRecorder
impl RefUnwindSafe for InMemoryToolEventRecorder
impl Send for InMemoryToolEventRecorder
impl Sync for InMemoryToolEventRecorder
impl Unpin for InMemoryToolEventRecorder
impl UnsafeUnpin for InMemoryToolEventRecorder
impl UnwindSafe for InMemoryToolEventRecorder
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