Struct PathAndQuery
struct PathAndQuery { ... }
Represents the path component of a URI
Implementations
impl PathAndQuery
fn from_static(src: &'static str) -> SelfConvert a
PathAndQueryfrom a static string.This function will not perform any copying, however the string is checked to ensure that it is valid.
Panics
This function panics if the argument is an invalid path and query.
Examples
# use *; let v = from_static; assert_eq!; assert_eq!;Attempt to convert a
Bytesbuffer to aPathAndQuery.This will try to prevent a copy if the type passed is the type used internally, and will copy the data if it is not.
fn path(self: &Self) -> &strReturns the path component
The path component is case sensitive.
abc://username:password@example.com:123/path/data?key=value&key2=value2#fragid1 |--------| | pathIf the URI is
*then the path component is equal to*.Examples
# use *; let path_and_query: PathAndQuery = "/hello/world".parse.unwrap; assert_eq!;fn query(self: &Self) -> Option<&str>Returns the query string component
The query component contains non-hierarchical data that, along with data in the path component, serves to identify a resource within the scope of the URI's scheme and naming authority (if any). The query component is indicated by the first question mark ("?") character and terminated by a number sign ("#") character or by the end of the URI.
abc://username:password@example.com:123/path/data?key=value&key2=value2#fragid1 |-------------------| | queryExamples
With a query string component
# use *; let path_and_query: PathAndQuery = "/hello/world?key=value&foo=bar".parse.unwrap; assert_eq!;Without a query string component
# use *; let path_and_query: PathAndQuery = "/hello/world".parse.unwrap; assert!;fn as_str(self: &Self) -> &strReturns the path and query as a string component.
Examples
With a query string component
# use *; let path_and_query: PathAndQuery = "/hello/world?key=value&foo=bar".parse.unwrap; assert_eq!;Without a query string component
# use *; let path_and_query: PathAndQuery = "/hello/world".parse.unwrap; assert_eq!;
impl Clone for PathAndQuery
fn clone(self: &Self) -> PathAndQuery
impl Debug for PathAndQuery
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Display for PathAndQuery
fn fmt(self: &Self, fmt: &mut Formatter<'_>) -> Result
impl Eq for PathAndQuery
impl Freeze for PathAndQuery
impl FromStr for PathAndQuery
fn from_str(s: &str) -> Result<Self, InvalidUri>
impl Hash for PathAndQuery
fn hash<H: hash::Hasher>(self: &Self, state: &mut H)
impl PartialEq for PathAndQuery
fn eq(self: &Self, other: &str) -> bool
impl PartialEq for PathAndQuery
fn eq(self: &Self, other: &PathAndQuery) -> bool
impl PartialEq for PathAndQuery
fn eq(self: &Self, other: &String) -> bool
impl PartialOrd for PathAndQuery
fn partial_cmp(self: &Self, other: &str) -> Option<Ordering>
impl PartialOrd for PathAndQuery
fn partial_cmp(self: &Self, other: &PathAndQuery) -> Option<Ordering>
impl PartialOrd for PathAndQuery
fn partial_cmp(self: &Self, other: &String) -> Option<Ordering>
impl RefUnwindSafe for PathAndQuery
impl Send for PathAndQuery
impl Sync for PathAndQuery
impl TryFrom for PathAndQuery
fn try_from(vec: Vec<u8>) -> Result<Self, <Self as >::Error>
impl TryFrom for PathAndQuery
fn try_from(s: &String) -> Result<Self, <Self as >::Error>
impl TryFrom for PathAndQuery
fn try_from(s: String) -> Result<Self, <Self as >::Error>
impl Unpin for PathAndQuery
impl UnsafeUnpin for PathAndQuery
impl UnwindSafe for PathAndQuery
impl<'a> PartialEq for PathAndQuery
fn eq(self: &Self, other: &&'a str) -> bool
impl<'a> PartialOrd for PathAndQuery
fn partial_cmp(self: &Self, other: &&'a str) -> Option<Ordering>
impl<'a> TryFrom for PathAndQuery
fn try_from(s: &'a str) -> Result<Self, <Self as >::Error>
impl<'a> TryFrom for PathAndQuery
fn try_from(s: &'a [u8]) -> Result<Self, <Self as >::Error>
impl<T> Any for PathAndQuery
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for PathAndQuery
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for PathAndQuery
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for PathAndQuery
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for PathAndQuery
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for PathAndQuery
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> ToString for PathAndQuery
fn to_string(self: &Self) -> String
impl<T, U> Into for PathAndQuery
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for PathAndQuery
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for PathAndQuery
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>