pub struct AppendPathPrefix<'p>(/* private fields */);Expand description
Appends a prefix to a path.
Unlike AppendPrefix, this joins slash-safely: trailing slashes are trimmed from the prefix at construction, so joining with a path that starts with / never produces //.
assert_eq!(AppendPathPrefix::new("/api").rewrite("/foo"), "/api/foo");
assert_eq!(AppendPathPrefix::new("/api/").rewrite("/foo"), "/api/foo");
assert_eq!(AppendPathPrefix::new("/").rewrite("/foo"), "/foo");Implementations§
Trait Implementations§
Source§impl<'p> Clone for AppendPathPrefix<'p>
impl<'p> Clone for AppendPathPrefix<'p>
Source§fn clone(&self) -> AppendPathPrefix<'p>
fn clone(&self) -> AppendPathPrefix<'p>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'p> Debug for AppendPathPrefix<'p>
impl<'p> Debug for AppendPathPrefix<'p>
impl<'p> Eq for AppendPathPrefix<'p>
Source§impl<'p> PartialEq for AppendPathPrefix<'p>
impl<'p> PartialEq for AppendPathPrefix<'p>
Source§impl PathRewriter for AppendPathPrefix<'_>
impl PathRewriter for AppendPathPrefix<'_>
impl<'p> StructuralPartialEq for AppendPathPrefix<'p>
Auto Trait Implementations§
impl<'p> Freeze for AppendPathPrefix<'p>
impl<'p> RefUnwindSafe for AppendPathPrefix<'p>
impl<'p> Send for AppendPathPrefix<'p>
impl<'p> Sync for AppendPathPrefix<'p>
impl<'p> Unpin for AppendPathPrefix<'p>
impl<'p> UnsafeUnpin for AppendPathPrefix<'p>
impl<'p> UnwindSafe for AppendPathPrefix<'p>
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.