pub struct AnnotationContext { /* private fields */ }Expand description
Context passed to annotation lifecycle hooks
Provides domain-agnostic primitives that annotation handlers use.
This is the ctx parameter in handlers like on_define(fn, ctx).
Implementations§
Source§impl AnnotationContext
impl AnnotationContext
pub fn new() -> Self
Sourcepub fn cache(&self) -> &AnnotationCache
pub fn cache(&self) -> &AnnotationCache
Get the cache for memoization
Sourcepub fn cache_mut(&mut self) -> &mut AnnotationCache
pub fn cache_mut(&mut self) -> &mut AnnotationCache
Get mutable cache for memoization
Sourcepub fn state(&self) -> &AnnotationState
pub fn state(&self) -> &AnnotationState
Get the per-annotation state
Sourcepub fn state_mut(&mut self) -> &mut AnnotationState
pub fn state_mut(&mut self) -> &mut AnnotationState
Get mutable per-annotation state
Sourcepub fn registry(&mut self, name: &str) -> &mut NamedRegistry
pub fn registry(&mut self, name: &str) -> &mut NamedRegistry
Get or create a named registry
Sourcepub fn emit(&mut self, event_type: &str, data: ValueWord)
pub fn emit(&mut self, event_type: &str, data: ValueWord)
Emit an event (for alerts, logging, etc.)
Sourcepub fn events(&self) -> &[EmittedEvent]
pub fn events(&self) -> &[EmittedEvent]
Get all emitted events
Sourcepub fn clear_events(&mut self)
pub fn clear_events(&mut self)
Clear emitted events
Sourcepub fn data_range(&self) -> &DataRangeState
pub fn data_range(&self) -> &DataRangeState
Get data range manipulation state
Sourcepub fn data_range_mut(&mut self) -> &mut DataRangeState
pub fn data_range_mut(&mut self) -> &mut DataRangeState
Get mutable data range manipulation state
Trait Implementations§
Source§impl Clone for AnnotationContext
impl Clone for AnnotationContext
Source§fn clone(&self) -> AnnotationContext
fn clone(&self) -> AnnotationContext
Returns a duplicate of the value. Read more
1.0.0 · 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 AnnotationContext
impl Debug for AnnotationContext
Auto Trait Implementations§
impl Freeze for AnnotationContext
impl RefUnwindSafe for AnnotationContext
impl Send for AnnotationContext
impl Sync for AnnotationContext
impl Unpin for AnnotationContext
impl UnsafeUnpin for AnnotationContext
impl UnwindSafe for AnnotationContext
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more