pub struct PreMapHook {
pub adapter: &'static str,
pub op: fn(_: &PreMapContext<'_>, phase: &str, _: &ParsedOp) -> Result<(), String>,
pub finish: fn(&PreMapContext<'_>) -> Result<(), String>,
}Expand description
SRD-117 §9.1 — lets an adapter see every op template the scenario will reach before the first phase runs.
The pre-map walk already visits every phase to count each shared resource’s uses. An adapter that submits one of these is also shown each op that resolves to it, and is called once more when the walk ends. That is how a shared resource learns its whole configuration before first use (the logfile adapter gathers every rule of a tail), and how one comes to exist before the first phase instead of at its first attach.
An op the hook cannot judge yet, because a field reads a name only
a phase’s scope binds, is the hook’s to pass over: map_op sees
the same op later with that scope.
Fields§
§adapter: &'static strThe adapter whose ops the hook is shown.
op: fn(_: &PreMapContext<'_>, phase: &str, _: &ParsedOp) -> Result<(), String>Called for each op of each phase the walk reaches, in walk order. An error stops the run before any phase starts.
finish: fn(&PreMapContext<'_>) -> Result<(), String>Called once when the walk ends, whether or not any op was seen.
Trait Implementations§
impl Collect for PreMapHook
Auto Trait Implementations§
impl Forget for PreMapHook
impl Freeze for PreMapHook
impl Move for PreMapHook
impl RefUnwindSafe for PreMapHook
impl Send for PreMapHook
impl Sync for PreMapHook
impl Unpin for PreMapHook
impl UnsafeUnpin for PreMapHookwhere
&'static str: UnsafeUnpin,
impl UnwindSafe for PreMapHookwhere
&'static str: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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