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 Href
impl Move for Href
impl RefUnwindSafe for Href
impl Send for Href
impl Sync for Href
impl Unpin for Href
impl UnsafeUnpin for Href
impl UnwindSafe for Href
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,
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