pub struct Rewrite { /* private fields */ }
Expand description
Rewrites
This struct allows for a flexible way to define path rewrites using regex.
It can handle both single and multiple rewrites, where each rewrite consists of a from
regex pattern and a to
replacement string.
rewrite:
from: '^/old/path/(.*)$'
to: '/new/path/$1'
or
rewrite:
- from: /testing
to: /production
- from: '^/old/path/(.*)$'
to: '/new/path/$1'
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rewrite
impl<'de> Deserialize<'de> for Rewrite
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Rewrite, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Rewrite, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Rewrite
impl RefUnwindSafe for Rewrite
impl Send for Rewrite
impl Sync for Rewrite
impl Unpin for Rewrite
impl UnwindSafe for Rewrite
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
Mutably borrows from an owned value. Read more