Struct server_fn::response::BrowserMockRes
source · 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<Self, ServerFnError<CustErr>>
fn try_from_string( _content_type: &str, _data: String, ) -> Result<Self, ServerFnError<CustErr>>
Attempts to convert a UTF-8 string into an HTTP response.
source§fn try_from_bytes(
_content_type: &str,
_data: Bytes,
) -> Result<Self, ServerFnError<CustErr>>
fn try_from_bytes( _content_type: &str, _data: Bytes, ) -> Result<Self, ServerFnError<CustErr>>
Attempts to convert a binary blob represented as bytes into an HTTP response.
source§fn error_response(_path: &str, _err: &ServerFnError<CustErr>) -> Self
fn error_response(_path: &str, _err: &ServerFnError<CustErr>) -> Self
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<Self, ServerFnError<CustErr>>
fn try_from_stream( _content_type: &str, _data: impl Stream<Item = Result<Bytes, ServerFnError<CustErr>>>, ) -> Result<Self, 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> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.