Struct Builder
struct Builder { ... }
A builder for Uris.
This type can be used to construct an instance of Uri
through a builder pattern.
Implementations
impl Builder
fn new() -> BuilderCreates a new default instance of
Builderto construct aUri.Examples
# use *; let uri = new .scheme .authority .path_and_query .build .unwrap;fn scheme<T>(self: Self, scheme: T) -> Self where T: TryInto<Scheme>, <T as TryInto<Scheme>>::Error: Into<Error>Set the
Schemefor this URI.Examples
# use *; let mut builder = new; builder.scheme;Set the
Authorityfor this URI.Examples
# use *; let uri = new .authority .build .unwrap;fn path_and_query<T>(self: Self, p_and_q: T) -> Self where T: TryInto<PathAndQuery>, <T as TryInto<PathAndQuery>>::Error: Into<Error>Set the
PathAndQueryfor this URI.Examples
# use *; let uri = new .path_and_query .build .unwrap;fn build(self: Self) -> Result<Uri, Error>Consumes this builder, and tries to construct a valid
Urifrom the configured pieces.Errors
This function may return an error if any previously configured argument failed to parse or get converted to the internal representation. For example if an invalid
schemewas specified viascheme("!@#%/^")the error will be returned when this function is called rather than whenschemewas called.Additionally, the various forms of URI require certain combinations of parts to be set to be valid. If the parts don't fit into any of the valid forms of URI, a new error is returned.
Examples
# use *; let uri = builder .build .unwrap;
impl Debug for Builder
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Default for Builder
fn default() -> Builder
impl Freeze for Builder
impl From for Builder
fn from(uri: Uri) -> Self
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnsafeUnpin for Builder
impl UnwindSafe for Builder
impl<T> Any for Builder
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Builder
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Builder
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for Builder
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for Builder
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Builder
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Builder
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>