pub struct BrowserMockRes;Expand description
A mocked response type that can be used in place of the actual server response, when compiling for the browser.
§Panics
This always panics if its methods are called. It is used solely to stub out the server response type when compiling for the client.
Trait Implementations§
Source§impl Res for BrowserMockRes
impl Res for BrowserMockRes
Source§fn error_response(_path: &str, _err: Bytes) -> BrowserMockRes
fn error_response(_path: &str, _err: Bytes) -> BrowserMockRes
Converts an error into a response, with a
500 status code and the error as its body.Source§fn content_type(&mut self, _content_type: &str)
fn content_type(&mut self, _content_type: &str)
Set the
Content-Type header for the response.Source§impl<E> TryRes<E> for BrowserMockRes
impl<E> TryRes<E> for BrowserMockRes
Source§fn try_from_string(
_content_type: &str,
_data: String,
) -> Result<BrowserMockRes, E>
fn try_from_string( _content_type: &str, _data: String, ) -> Result<BrowserMockRes, E>
Attempts to convert a UTF-8 string into an HTTP response.
Source§fn try_from_bytes(
_content_type: &str,
_data: Bytes,
) -> Result<BrowserMockRes, E>
fn try_from_bytes( _content_type: &str, _data: Bytes, ) -> Result<BrowserMockRes, E>
Attempts to convert a binary blob represented as bytes into an HTTP response.
Source§fn try_from_stream(
_content_type: &str,
_data: impl Stream<Item = Result<Bytes, Bytes>>,
) -> Result<BrowserMockRes, E>
fn try_from_stream( _content_type: &str, _data: impl Stream<Item = Result<Bytes, Bytes>>, ) -> Result<BrowserMockRes, E>
Attempts to convert a stream of bytes into an HTTP response.
Auto Trait Implementations§
impl Freeze for BrowserMockRes
impl RefUnwindSafe for BrowserMockRes
impl Send for BrowserMockRes
impl Sync for BrowserMockRes
impl Unpin for BrowserMockRes
impl UnwindSafe for BrowserMockRes
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 moreSource§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.