[][src]Struct pathetic::Uri

pub struct Uri(_);

The relative URI container

Methods

impl Uri[src]

pub fn new(input: &str) -> Result<Self, ParseError>[src]

Create a new Uri, from a path-query-fragment str.

pub fn join(&self, input: &str) -> Result<Self, ParseError>[src]

Parse a string as an URL, with this URL as the base URL.

pub fn as_str(&self) -> &str[src]

Return the serialization of this URL.

pub fn path(&self) -> &str[src]

Return the path for this URL, as a percent-encoded ASCII string.

pub fn query(&self) -> Option<&str>[src]

Return this URL's query string, if any, as a percent-encoded ASCII string.

pub fn fragment(&self) -> Option<&str>[src]

Return this URL's fragment identifier, if any.

pub fn path_segments(&self) -> Split<char>[src]

Return an iterator of '/' slash-separated path segments, each as a percent-encoded ASCII string.

pub fn path_segments_mut(&mut self) -> PathSegmentsMut[src]

Return an object with methods to manipulate this URL's path segments.

pub fn query_pairs(&self) -> Parse[src]

Parse the URL's query string, if any, as application/x-www-form-urlencoded and return an iterator of (key, value) pairs.

pub fn query_pairs_mut(&mut self) -> Serializer<UrlQuery>[src]

Manipulate this URL's query string, viewed as a sequence of name/value pairs in application/x-www-form-urlencoded syntax.

pub fn set_path(&mut self, path: &str)[src]

Change this URL's path.

pub fn set_query(&mut self, query: Option<&str>)[src]

Change this URL's query string.

pub fn set_fragment(&mut self, fragment: Option<&str>)[src]

Change this URL's fragment identifier.

pub fn with_path(self, path: &str) -> Self[src]

Modify the path inline.

pub fn with_query(self, query: Option<&str>) -> Self[src]

Modify the fragment inline.

pub fn with_fragment(self, fragment: Option<&str>) -> Self[src]

Modify the fragment inline.

pub fn with_path_segments_mut<F>(self, cls: F) -> Self where
    F: for<'a, 'b> Fn(&'b mut PathSegmentsMut<'a>) -> &'b mut PathSegmentsMut<'a>, 
[src]

Modify the path segments inline.

pub fn with_query_pairs_mut<F>(self, cls: F) -> Self where
    F: for<'a, 'b> Fn(&'b mut Serializer<'a, UrlQuery<'a>>) -> &'b mut Serializer<'a, UrlQuery<'a>>, 
[src]

Modify the query pairs inline.

Trait Implementations

impl AsRef<str> for Uri[src]

impl Clone for Uri[src]

impl Debug for Uri[src]

impl Default for Uri[src]

impl Display for Uri[src]

impl Eq for Uri[src]

impl Ord for Uri[src]

impl PartialEq<Uri> for Uri[src]

impl PartialOrd<Uri> for Uri[src]

impl StructuralEq for Uri[src]

impl StructuralPartialEq for Uri[src]

impl<'_> TryFrom<&'_ str> for Uri[src]

type Error = ParseError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Uri

impl Send for Uri

impl Sync for Uri

impl Unpin for Uri

impl UnwindSafe for Uri

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.