pub struct Href { /* private fields */ }Expand description
A url being built from a route pattern, see href. Turned into a url with
Display or String::from.
Implementations§
Source§impl Href
impl Href
Sourcepub fn param(self, name: &str, value: impl Display) -> Self
pub fn param(self, name: &str, value: impl Display) -> Self
Sets the parameter name: {name}, {name=matcher}, {?name} (left out of the url
unless set) or {*name} (whose value may contain slashes).
Panics if the pattern has no such parameter.
Sourcepub fn query(self, query: &impl Serialize) -> Self
pub fn query(self, query: &impl Serialize) -> Self
Sets the query from a flat struct or a sequence of pairs, with serde_urlencoded (the
format Query reads). None fields are left out, and an empty
query adds no ?. Replaces an earlier query.
Panics if query can’t be serialized, e.g. a struct with nested structs.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Href
impl Freeze for Hrefwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Segment>: Freeze,
PhantomData<(String, String)>: Freeze,
impl Move for Href
impl RefUnwindSafe for Href
impl Send for Hrefwhere
RawVecInner: Send,
impl Sync for Hrefwhere
RawVecInner: Sync,
impl Unpin for Href
impl UnsafeUnpin for Hrefwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Segment>: UnsafeUnpin,
PhantomData<(String, String)>: UnsafeUnpin,
impl UnwindSafe for Hrefwhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more