Struct url_builder::URLBuilder

source ·
pub struct URLBuilder { /* private fields */ }

Implementations§

Creates a new URLBuilder instance

Example
use url_builder::URLBuilder;

let mut ub = URLBuilder::new();
Examples found in repository?
src/lib.rs (line 44)
43
44
45
    fn default() -> Self {
        Self::new()
    }

Consumes the builder and returns a String, with the formatted url.

Example
use url_builder::URLBuilder;

let mut ub = URLBuilder::new();
ub.set_protocol("http")
    .set_host("localhost")
    .set_port(8000)
    .add_route("query")
    .add_param("first", "1")
    .add_param("second", "2")
    .add_param("third", "3");

let built_url = ub.build();

Adds a parameter to the URL.

Sets the protocol that the URL builder will use.

Sets the protocol that the URL builder will use.

Sets the port that the URL builder will use.

Adds a route to the URL.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.