[][src]Struct uri_builder::URI

pub struct URI<'a> { /* fields omitted */ }

Struct that corresponds with URI.

Implementations

impl<'a> URI<'a>[src]

pub fn new(scheme: &'a str) -> URI<'a>[src]

Construct empty URI with scheme only.

pub fn userinfo(&'a mut self, value: &'a str) -> &'a mut URI<'_>[src]

Set userinfo.

pub fn host(&'a mut self, value: &'a str) -> &'a mut URI<'_>[src]

Set host.

pub fn port(&'a mut self, value: u16) -> &'a mut URI<'_>[src]

Set port.

pub fn path(&'a mut self, segment: &'a str) -> &'a mut URI<'_>[src]

Add passed segment to path.

pub fn path_vec(&'a mut self, segments: &Vec<&'a str>) -> &'a mut URI<'_>[src]

Add passed multiple segments to path.

pub fn query<T, U>(&'a mut self, attribute: U, value: T) -> &'a mut URI<'_> where
    T: ToString,
    U: ToString
[src]

Add passed segment to query.

pub fn query_vec<T, U>(&'a mut self, values: &Vec<(T, U)>) -> &'a mut URI<'_> where
    T: ToString,
    U: ToString
[src]

Add passed multiple segments to query.

pub fn fragment(&'a mut self, value: &'a str) -> &'a mut URI<'_>[src]

Set fragment.

pub fn build(&'a self) -> String[src]

Build URI form received parts.

use uri_builder::URI;

let uri: String = URI::new("https")
    .host("github.com")
    .path("repos")
    .query("page", 1)
    .build();

The example above transforms to https://github.com/repos?page=1.

Trait Implementations

impl<'a> Default for URI<'a>[src]

fn default() -> URI<'a>[src]

Construct URI http://localhost:80/.

Auto Trait Implementations

impl<'a> RefUnwindSafe for URI<'a>

impl<'a> Send for URI<'a>

impl<'a> Sync for URI<'a>

impl<'a> Unpin for URI<'a>

impl<'a> UnwindSafe for URI<'a>

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, 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.