pub struct Endpoint {
buf: String,
has_query: bool,
}Expand description
A path plus query string, which knows whether it needs ? or & next.
The manual separator juggling this replaces produced the double-ampersand and trailing-ampersand cases an earlier test file spent four assertions on. Making it structural is cheaper than testing for it.
Fields§
§buf: String§has_query: boolImplementations§
Source§impl Endpoint
impl Endpoint
pub fn new(path: &str) -> Self
fn separator(&mut self) -> char
Sourcepub fn param(self, key: &str, value: &str) -> Self
pub fn param(self, key: &str, value: &str) -> Self
Append key=value, percent-encoding the value.
Sourcepub fn raw_param(self, key: &str, value: &str) -> Self
pub fn raw_param(self, key: &str, value: &str) -> Self
Append key=value verbatim. Only for values this module composed.
pub fn build(self) -> String
Auto Trait Implementations§
impl Freeze for Endpoint
impl RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnsafeUnpin for Endpoint
impl UnwindSafe for Endpoint
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