pub trait MatchHook: Send + Sync {
// Required methods
fn symbol(&self) -> Symbol;
fn kind(&self) -> MatchHookKind;
fn apply(
&self,
cx: &mut Cx,
ctx: &MatchHookContext,
current: Option<&ShapeMatch>,
) -> Result<MatchHookDecision>;
// Provided method
fn object_encoding(&self) -> Option<ObjectEncoding> { ... }
}Expand description
Runtime hook contract for neutral shape match membranes.
Required Methods§
Sourcefn kind(&self) -> MatchHookKind
fn kind(&self) -> MatchHookKind
Decision class this hook may produce.
Sourcefn apply(
&self,
cx: &mut Cx,
ctx: &MatchHookContext,
current: Option<&ShapeMatch>,
) -> Result<MatchHookDecision>
fn apply( &self, cx: &mut Cx, ctx: &MatchHookContext, current: Option<&ShapeMatch>, ) -> Result<MatchHookDecision>
Run the hook for the supplied context and current match state.
Provided Methods§
Sourcefn object_encoding(&self) -> Option<ObjectEncoding>
fn object_encoding(&self) -> Option<ObjectEncoding>
Constructor encoding for pure, descriptor-backed built-in hooks.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".