pub struct CompiledRewrite { /* private fields */ }Expand description
Precompiled zero-allocation-fast-path URL rewrite & redirect engine backing RewritePlugin.
Implementations§
Source§impl CompiledRewrite
Inherent compilation and hot-path request evaluation for CompiledRewrite.
impl CompiledRewrite
Inherent compilation and hot-path request evaluation for CompiledRewrite.
Sourcepub fn compile(config: RewriteConfig) -> Result<Self, RewriteError>
pub fn compile(config: RewriteConfig) -> Result<Self, RewriteError>
Sourcepub fn get_config(&self) -> &RewriteConfig
pub fn get_config(&self) -> &RewriteConfig
Sourcepub fn apply(&self, ctx: &mut Context) -> RewriteOutcome
pub fn apply(&self, ctx: &mut Context) -> RewriteOutcome
Evaluates canonical host/HTTPS, path normalization, exact, prefix, and regex rules against ctx.
On an internal rewrite, updates ctx.get_mut_request().set_path(...) and stores the original
path under ATTR_ORIGINAL_PATH. On a redirect, populates ctx.get_mut_response() with the
redirect status code and sanitized Location header.
§Arguments
&mut Context- Active Hyperlane request/response context.
§Returns
RewriteOutcome- Whether the request was unchanged, rewritten internally, or redirected.
Trait Implementations§
Source§impl Clone for CompiledRewrite
impl Clone for CompiledRewrite
Auto Trait Implementations§
impl Forget for CompiledRewrite
impl Freeze for CompiledRewritewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<ExactRewriteRule>: Freeze,
PhantomData<PrefixRewriteRule>: Freeze,
PhantomData<RegexRewriteRule>: Freeze,
PhantomData<fn() -> XxHash3_64>: Freeze,
PhantomData<(String, CompiledExactTarget)>: Freeze,
PhantomData<CompiledPrefixRule>: Freeze,
PhantomData<CompiledRegexRule>: Freeze,
impl Move for CompiledRewrite
impl RefUnwindSafe for CompiledRewritewhere
Atomic<usize>: RefUnwindSafe,
Pool<Cache, Box<dyn Fn() -> Cache + Sync + UnwindSafe + RefUnwindSafe + Send>>: RefUnwindSafe,
impl Send for CompiledRewrite
impl Sync for CompiledRewrite
impl Unpin for CompiledRewrite
impl UnsafeUnpin for CompiledRewritewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<ExactRewriteRule>: UnsafeUnpin,
PhantomData<PrefixRewriteRule>: UnsafeUnpin,
PhantomData<RegexRewriteRule>: UnsafeUnpin,
PhantomData<fn() -> XxHash3_64>: UnsafeUnpin,
PhantomData<(String, CompiledExactTarget)>: UnsafeUnpin,
PhantomData<CompiledPrefixRule>: UnsafeUnpin,
PhantomData<CompiledRegexRule>: UnsafeUnpin,
impl UnwindSafe for CompiledRewritewhere
RawVecInner: UnwindSafe,
HashMap<String, CompiledExactTarget, BuildHasherDefault<XxHash3_64>>: UnwindSafe,
Arc<RegexI>: UnwindSafe,
BoxRaw<Pool<Cache, Box<dyn Fn() -> Cache + Sync + UnwindSafe + RefUnwindSafe + Send>>>: UnwindSafe,
Arc<str>: UnwindSafe,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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