pub struct URL;Expand description
URL parsing, building, and percent-encoding utilities.
Implementations§
Source§impl URL
impl URL
pub fn percent_encode(component: &str) -> String
pub fn percent_decode(component: &str) -> String
Sourcepub fn form_decode(component: &str) -> String
pub fn form_decode(component: &str) -> String
A query or form value: + is a space, %HH a byte, the bytes read
as UTF-8 (invalid sequences become U+FFFD); a % without two hex
digits stays as it is (18.24.0).
pub fn build_query(params: HashMap<String, String>) -> String
pub fn parse_query(component: &str) -> HashMap<String, String>
pub fn build(components: UrlComponents) -> Result<String, String>
pub fn parse(url: &str) -> Result<UrlComponents, String>
Sourcepub fn parse_request_target(target: &str) -> Result<UrlComponents, String>
pub fn parse_request_target(target: &str) -> Result<UrlComponents, String>
Parse an origin-form request target (/path?query) — what
Request::request_uri holds. Anything not starting with / is an
error rather than being glued onto a placeholder authority, where a
target like :x would become the port of http://localhost:x.
Auto Trait Implementations§
impl Freeze for URL
impl RefUnwindSafe for URL
impl Send for URL
impl Sync for URL
impl Unpin for URL
impl UnsafeUnpin for URL
impl UnwindSafe for URL
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Available on crate feature
map-response-body only.Apply a transformation to the response body. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Available on crate feature
trace only.High level tracing that classifies responses using gRPC headers. Read more