Struct routefinder::Capture
source · pub struct Capture<'key, 'value> { /* private fields */ }
Expand description
An individual key-value pair
Implementations§
source§impl<'key, 'value> Capture<'key, 'value>
impl<'key, 'value> Capture<'key, 'value>
sourcepub fn new(
key: impl Into<Cow<'key, str>>,
value: impl Into<Cow<'value, str>>
) -> Self
pub fn new( key: impl Into<Cow<'key, str>>, value: impl Into<Cow<'value, str>> ) -> Self
Build a new Capture from the provided key and value. Passing a &str here is preferable, but a String will also work.
sourcepub fn into_owned(self) -> Capture<'static, 'static>
pub fn into_owned(self) -> Capture<'static, 'static>
transforms this potentially-borrowed Capture into a ’static capture that can outlive the source data. This allocates new strings if needed, and should be avoided unless necessary for a particular application
Trait Implementations§
Auto Trait Implementations§
impl<'key, 'value> RefUnwindSafe for Capture<'key, 'value>
impl<'key, 'value> Send for Capture<'key, 'value>
impl<'key, 'value> Sync for Capture<'key, 'value>
impl<'key, 'value> Unpin for Capture<'key, 'value>
impl<'key, 'value> UnwindSafe for Capture<'key, 'value>
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