pub struct HttpWrapper<T> { /* private fields */ }
Expand description
Local wrapper for Http
Implementations§
Source§impl<T> HttpWrapper<T>
impl<T> HttpWrapper<T>
Sourcepub const fn with_client(client: T, url: Url) -> Self
pub const fn with_client(client: T, url: Url) -> Self
Create a new [Http
] transport with a custom client.
Sourcepub fn set_client(&mut self, client: T)
pub fn set_client(&mut self, client: T)
Set the client.
Sourcepub fn guess_local(&self) -> bool
pub fn guess_local(&self) -> bool
Guess whether the URL is local, based on the hostname.
The output of this function is best-efforts, and should be checked if
possible. It simply returns true
if the connection has no hostname,
or the hostname is localhost
or 127.0.0.1
.
Trait Implementations§
Source§impl<T: Clone> Clone for HttpWrapper<T>
impl<T: Clone> Clone for HttpWrapper<T>
Source§fn clone(&self) -> HttpWrapper<T>
fn clone(&self) -> HttpWrapper<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for HttpWrapper<T>
impl<T: Debug> Debug for HttpWrapper<T>
Source§impl<T: Clone> From<Http<T>> for HttpWrapper<T>
impl<T: Clone> From<Http<T>> for HttpWrapper<T>
Source§impl<T: Clone> From<HttpWrapper<T>> for Http<T>
impl<T: Clone> From<HttpWrapper<T>> for Http<T>
Source§fn from(value: HttpWrapper<T>) -> Self
fn from(value: HttpWrapper<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<T> Freeze for HttpWrapper<T>where
T: Freeze,
impl<T> RefUnwindSafe for HttpWrapper<T>where
T: RefUnwindSafe,
impl<T> Send for HttpWrapper<T>where
T: Send,
impl<T> Sync for HttpWrapper<T>where
T: Sync,
impl<T> Unpin for HttpWrapper<T>where
T: Unpin,
impl<T> UnwindSafe for HttpWrapper<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more