Skip to main content

BeforeModelScope

Struct BeforeModelScope 

Source
pub struct BeforeModelScope<'a> { /* private fields */ }
Expand description

ModelHooks::before_model scope over one immutable request and Step snapshot.

Implementations§

Source§

impl BeforeModelScope<'_>

Source

pub const fn session(&self) -> SessionIdentity<'_>

Returns stable Session identity without broader Session authority.

Source

pub const fn coord(&self) -> &Coord

Returns the immutable callback coordinate.

Source

pub const fn run_state(&self) -> &Store

Returns this hook’s private per-Run scratch store.

Source

pub const fn session_state(&self) -> &Reader

Returns owned-snapshot Session-state read authority.

Source

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.

Source

pub const fn session_state_writer(&self) -> Option<&Writer>

Returns lease-bound write authority only for a hook which declared requires_session_state(true).

Source

pub fn emit_audit(&self, event: Event)

Emits an audit fact through the capability-narrowed boundary.

Source

pub fn emit_error(&self, error: Arc<dyn Error + Send + Sync>)

Emits a non-fatal error through the capability-narrowed boundary.

Source

pub fn snapshot(&self) -> &StepSnapshot

Returns the exact frozen Step snapshot.

Source

pub const fn request(&self) -> &Request

Returns the current frozen request; rewrites use the returned decision.

Trait Implementations§

Source§

impl<'a> Debug for BeforeModelScope<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.