kvarn_utils::prelude::uri

Struct Builder

pub struct Builder { /* private fields */ }
Expand description

A builder for Uris.

This type can be used to construct an instance of Uri through a builder pattern.

Implementations§

§

impl Builder

pub fn new() -> Builder

Creates a new default instance of Builder to construct a Uri.

§Examples

let uri = uri::Builder::new()
    .scheme("https")
    .authority("hyper.rs")
    .path_and_query("/")
    .build()
    .unwrap();

pub fn scheme<T>(self, scheme: T) -> Builder
where Scheme: TryFrom<T>, <Scheme as TryFrom<T>>::Error: Into<Error>,

Set the Scheme for this URI.

§Examples

let mut builder = uri::Builder::new();
builder.scheme("https");