pub struct Uri(/* private fields */);Expand description
The relative URI container
Implementations§
Source§impl Uri
impl Uri
Sourcepub fn new(input: &str) -> Result<Self, ParseError>
pub fn new(input: &str) -> Result<Self, ParseError>
Create a new Uri, from a path-query-fragment str.
Sourcepub fn join(&self, input: &str) -> Result<Self, ParseError>
pub fn join(&self, input: &str) -> Result<Self, ParseError>
Parse a string as an URL, with this URL as the base URL.
Sourcepub fn query(&self) -> Option<&str>
pub fn query(&self) -> Option<&str>
Return this URL’s query string, if any, as a percent-encoded ASCII string.
Sourcepub fn path_segments(&self) -> Split<'_, char>
pub fn path_segments(&self) -> Split<'_, char>
Return an iterator of ‘/’ slash-separated path segments, each as a percent-encoded ASCII string.
Sourcepub fn path_segments_mut(&mut self) -> PathSegmentsMut<'_>
pub fn path_segments_mut(&mut self) -> PathSegmentsMut<'_>
Return an object with methods to manipulate this URL’s path segments.
Sourcepub fn query_pairs(&self) -> Parse<'_>
pub fn query_pairs(&self) -> Parse<'_>
Parse the URL’s query string, if any, as application/x-www-form-urlencoded and return an iterator of (key, value) pairs.
Sourcepub fn query_pairs_mut(&mut self) -> Serializer<'_, UrlQuery<'_>>
pub fn query_pairs_mut(&mut self) -> Serializer<'_, UrlQuery<'_>>
Manipulate this URL’s query string, viewed as a sequence of name/value pairs in application/x-www-form-urlencoded syntax.
Sourcepub fn set_fragment(&mut self, fragment: Option<&str>)
pub fn set_fragment(&mut self, fragment: Option<&str>)
Change this URL’s fragment identifier.
Sourcepub fn with_query(self, query: Option<&str>) -> Self
pub fn with_query(self, query: Option<&str>) -> Self
Modify the fragment inline.
Sourcepub fn with_fragment(self, fragment: Option<&str>) -> Self
pub fn with_fragment(self, fragment: Option<&str>) -> Self
Modify the fragment inline.
Sourcepub fn with_path_segments_mut<F>(self, cls: F) -> Self
pub fn with_path_segments_mut<F>(self, cls: F) -> Self
Modify the path segments inline.
Sourcepub fn with_query_pairs_mut<F>(self, cls: F) -> Selfwhere
F: for<'a, 'b> Fn(&'b mut Serializer<'a, UrlQuery<'a>>) -> &'b mut Serializer<'a, UrlQuery<'a>>,
pub fn with_query_pairs_mut<F>(self, cls: F) -> Selfwhere
F: for<'a, 'b> Fn(&'b mut Serializer<'a, UrlQuery<'a>>) -> &'b mut Serializer<'a, UrlQuery<'a>>,
Modify the query pairs inline.