pub struct Url<'a, 'queries> {
pub path: &'a str,
pub query_params: Option<&'queries [QueryParam<'a>]>,
}
Expand description
The path and query parameters part of an HTTP URL
Fields§
§path: &'a str
The path part for the URL
query_params: Option<&'queries [QueryParam<'a>]>
The query parameters part for the URL
Implementations§
Source§impl<'a, 'queries> Url<'a, 'queries>
impl<'a, 'queries> Url<'a, 'queries>
Sourcepub fn new(
path: &'a str,
query_params: Option<&'queries [QueryParam<'a>]>,
) -> Url<'a, 'queries>
pub fn new( path: &'a str, query_params: Option<&'queries [QueryParam<'a>]>, ) -> Url<'a, 'queries>
Construct a new Url
from its parts.
Sourcepub fn parse(
slice: &'a [u8],
queries_buf: &'queries mut [QueryParam<'a>],
) -> Result<Url<'a, 'queries>, UrlError>
pub fn parse( slice: &'a [u8], queries_buf: &'queries mut [QueryParam<'a>], ) -> Result<Url<'a, 'queries>, UrlError>
Parses the bytes of an HTTP URL into a Url
The URL you parse must be valid UTF-8 and must be stripped of the leading protocol and authority parts or an Err(UrlError::Path) is returned
If you pass an empty queries_buf
, it will not parse query parameters
If there is more query parameters than the length of the passed queries_buf
, an Err(UrlError::TooManyQueryParams) is returned
Trait Implementations§
impl<'a, 'queries> Eq for Url<'a, 'queries>
impl<'a, 'queries> StructuralPartialEq for Url<'a, 'queries>
Auto Trait Implementations§
impl<'a, 'queries> Freeze for Url<'a, 'queries>
impl<'a, 'queries> RefUnwindSafe for Url<'a, 'queries>
impl<'a, 'queries> Send for Url<'a, 'queries>
impl<'a, 'queries> Sync for Url<'a, 'queries>
impl<'a, 'queries> Unpin for Url<'a, 'queries>
impl<'a, 'queries> UnwindSafe for Url<'a, 'queries>
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