pub struct Client<E: Endpoint> { /* private fields */ }Expand description
A wrapper struct of an endpoint which adds the facility for testing.
Implementations§
Source§impl<E: Endpoint> Client<E>
impl<E: Endpoint> Client<E>
Sourcepub fn request<'a, M, U>(&'a self, method: M, uri: U) -> ClientRequest<'a, E>
pub fn request<'a, M, U>(&'a self, method: M, uri: U) -> ClientRequest<'a, E>
Create a dummy request with given HTTP method and URI.
Source§impl<E: Endpoint> Client<E>
impl<E: Endpoint> Client<E>
Sourcepub fn get<'a, U>(&'a self, uri: U) -> ClientRequest<'a, E>where
Uri: HttpTryFrom<U>,
pub fn get<'a, U>(&'a self, uri: U) -> ClientRequest<'a, E>where
Uri: HttpTryFrom<U>,
Create a dummy GET request with given URI.
Sourcepub fn post<'a, U>(&'a self, uri: U) -> ClientRequest<'a, E>where
Uri: HttpTryFrom<U>,
pub fn post<'a, U>(&'a self, uri: U) -> ClientRequest<'a, E>where
Uri: HttpTryFrom<U>,
Create a dummy POST request with given URI.
Sourcepub fn put<'a, U>(&'a self, uri: U) -> ClientRequest<'a, E>where
Uri: HttpTryFrom<U>,
pub fn put<'a, U>(&'a self, uri: U) -> ClientRequest<'a, E>where
Uri: HttpTryFrom<U>,
Create a dummy PUT request with given URI.
Sourcepub fn head<'a, U>(&'a self, uri: U) -> ClientRequest<'a, E>where
Uri: HttpTryFrom<U>,
pub fn head<'a, U>(&'a self, uri: U) -> ClientRequest<'a, E>where
Uri: HttpTryFrom<U>,
Create a dummy HEAD request with given URI.
Sourcepub fn delete<'a, U>(&'a self, uri: U) -> ClientRequest<'a, E>where
Uri: HttpTryFrom<U>,
pub fn delete<'a, U>(&'a self, uri: U) -> ClientRequest<'a, E>where
Uri: HttpTryFrom<U>,
Create a dummy DELETE request with given URI.
Sourcepub fn patch<'a, U>(&'a self, uri: U) -> ClientRequest<'a, E>where
Uri: HttpTryFrom<U>,
pub fn patch<'a, U>(&'a self, uri: U) -> ClientRequest<'a, E>where
Uri: HttpTryFrom<U>,
Create a dummy PATCH request with given URI.
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for Client<E>where
E: Freeze,
impl<E> RefUnwindSafe for Client<E>where
E: RefUnwindSafe,
impl<E> Send for Client<E>
impl<E> Sync for Client<E>
impl<E> Unpin for Client<E>where
E: Unpin,
impl<E> UnwindSafe for Client<E>where
E: 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> 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