[−][src]Struct uri_builder::URI
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]
T: ToString,
U: ToString,
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]
T: ToString,
U: ToString,
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,