Struct reverse_proxy_service::rewrite::TrimPrefix
source · pub struct TrimPrefix<'a>(pub &'a str);
Expand description
Trims a prefix if exists.
assert_eq!(TrimPrefix("foo").rewrite("foobarfoo"), "barfoo");
assert_eq!(TrimPrefix("bar").rewrite("foobarfoo"), "foobarfoo");
Tuple Fields§
§0: &'a str
Trait Implementations§
source§impl<'a> Clone for TrimPrefix<'a>
impl<'a> Clone for TrimPrefix<'a>
source§fn clone(&self) -> TrimPrefix<'a>
fn clone(&self) -> TrimPrefix<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a> Debug for TrimPrefix<'a>
impl<'a> Debug for TrimPrefix<'a>
source§impl<'a> PartialEq<TrimPrefix<'a>> for TrimPrefix<'a>
impl<'a> PartialEq<TrimPrefix<'a>> for TrimPrefix<'a>
source§fn eq(&self, other: &TrimPrefix<'a>) -> bool
fn eq(&self, other: &TrimPrefix<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PathRewriter for TrimPrefix<'_>
impl PathRewriter for TrimPrefix<'_>
impl<'a> Copy for TrimPrefix<'a>
impl<'a> Eq for TrimPrefix<'a>
impl<'a> StructuralEq for TrimPrefix<'a>
impl<'a> StructuralPartialEq for TrimPrefix<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for TrimPrefix<'a>
impl<'a> Send for TrimPrefix<'a>
impl<'a> Sync for TrimPrefix<'a>
impl<'a> Unpin for TrimPrefix<'a>
impl<'a> UnwindSafe for TrimPrefix<'a>
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.