pub trait RewriteRule: Send + Sync {
// Required methods
fn name(&self) -> &'static str;
fn decide(
&self,
command: &str,
request_id: &str,
session_id: Option<&str>,
ctx: &AppContext,
) -> RewriteDecision;
fn execute(&self, request: &RewriteRequest, ctx: &AppContext) -> Response;
}Expand description
A rewrite rule owns both the pre-execution shape decision and the typed request it emits. Implementations keep parsing in the decision phase so an accepted request has one stable request ID and one decision class.
Required Methods§
fn name(&self) -> &'static str
fn decide( &self, command: &str, request_id: &str, session_id: Option<&str>, ctx: &AppContext, ) -> RewriteDecision
fn execute(&self, request: &RewriteRequest, ctx: &AppContext) -> Response
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".