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<CustErr> Res<CustErr> for BrowserMockRes
impl<CustErr> Res<CustErr> for BrowserMockRes
Source§fn try_from_string(
_content_type: &str,
_data: String,
) -> Result<BrowserMockRes, ServerFnError<CustErr>>
fn try_from_string( _content_type: &str, _data: String, ) -> Result<BrowserMockRes, ServerFnError<CustErr>>
Attempts to convert a UTF-8 string into an HTTP response.
Source§fn try_from_bytes(
_content_type: &str,
_data: Bytes,
) -> Result<BrowserMockRes, ServerFnError<CustErr>>
fn try_from_bytes( _content_type: &str, _data: Bytes, ) -> Result<BrowserMockRes, ServerFnError<CustErr>>
Attempts to convert a binary blob represented as bytes into an HTTP response.
Source§fn error_response(_path: &str, _err: &ServerFnError<CustErr>) -> BrowserMockRes
fn error_response(_path: &str, _err: &ServerFnError<CustErr>) -> BrowserMockRes
Converts an error into a response, with a
500
status code and the error text as its body.Source§fn try_from_stream(
_content_type: &str,
_data: impl Stream<Item = Result<Bytes, ServerFnError<CustErr>>>,
) -> Result<BrowserMockRes, ServerFnError<CustErr>>
fn try_from_stream( _content_type: &str, _data: impl Stream<Item = Result<Bytes, ServerFnError<CustErr>>>, ) -> Result<BrowserMockRes, ServerFnError<CustErr>>
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> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
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<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.