pub struct BeforeModelScope<'a> { /* private fields */ }Expand description
ModelHooks::before_model scope over one immutable request and Step snapshot.
Implementations§
Source§impl BeforeModelScope<'_>
impl BeforeModelScope<'_>
Sourcepub const fn session(&self) -> SessionIdentity<'_>
pub const fn session(&self) -> SessionIdentity<'_>
Returns stable Session identity without broader Session authority.
Sourcepub const fn session_state(&self) -> &Reader
pub const fn session_state(&self) -> &Reader
Returns owned-snapshot Session-state read authority.
Sourcepub fn transcript(&self) -> Result<Snapshot, Error>
pub fn transcript(&self) -> Result<Snapshot, Error>
Captures the complete transcript at this callback’s phase position.
§Errors
Returns store::Error::Poisoned if the underlying transcript lock
was poisoned.
Sourcepub const fn session_state_writer(&self) -> Option<&Writer>
pub const fn session_state_writer(&self) -> Option<&Writer>
Returns lease-bound write authority only for a hook which declared
requires_session_state(true).
Sourcepub fn emit_audit(&self, event: Event)
pub fn emit_audit(&self, event: Event)
Emits an audit fact through the capability-narrowed boundary.
Sourcepub fn emit_error(&self, error: Arc<dyn Error + Send + Sync>)
pub fn emit_error(&self, error: Arc<dyn Error + Send + Sync>)
Emits a non-fatal error through the capability-narrowed boundary.
Sourcepub fn snapshot(&self) -> &StepSnapshot
pub fn snapshot(&self) -> &StepSnapshot
Returns the exact frozen Step snapshot.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for BeforeModelScope<'a>
impl<'a> !UnwindSafe for BeforeModelScope<'a>
impl<'a> Freeze for BeforeModelScope<'a>
impl<'a> Send for BeforeModelScope<'a>
impl<'a> Sync for BeforeModelScope<'a>
impl<'a> Unpin for BeforeModelScope<'a>
impl<'a> UnsafeUnpin for BeforeModelScope<'a>
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