Struct server_fn::error::ServerFnUrlError
source · pub struct ServerFnUrlError<CustErr> { /* private fields */ }
Expand description
Associates a particular server function error with the server function found at a particular path.
This can be used to pass an error from the server back to the client without JavaScript/WASM supported, by encoding it in the URL as a query string. This is useful for progressive enhancement.
Implementations§
source§impl<CustErr> ServerFnUrlError<CustErr>
impl<CustErr> ServerFnUrlError<CustErr>
sourcepub fn new(path: impl Display, error: ServerFnError<CustErr>) -> Self
pub fn new(path: impl Display, error: ServerFnError<CustErr>) -> Self
Creates a new structure associating the server function at some path with a particular error.
sourcepub fn error(&self) -> &ServerFnError<CustErr>
pub fn error(&self) -> &ServerFnError<CustErr>
The error itself.
sourcepub fn to_url(&self, base: &str) -> Result<Url, ParseError>
pub fn to_url(&self, base: &str) -> Result<Url, ParseError>
Adds an encoded form of this server function error to the given base URL.
sourcepub fn strip_error_info(path: &mut String)
pub fn strip_error_info(path: &mut String)
Replaces any ServerFnUrlError info from the URL in the given string with the serialized success value given.
Trait Implementations§
source§impl<CustErr: Debug> Debug for ServerFnUrlError<CustErr>
impl<CustErr: Debug> Debug for ServerFnUrlError<CustErr>
source§impl<CustErr> From<ServerFnUrlError<CustErr>> for ServerFnError<CustErr>
impl<CustErr> From<ServerFnUrlError<CustErr>> for ServerFnError<CustErr>
source§fn from(error: ServerFnUrlError<CustErr>) -> Self
fn from(error: ServerFnUrlError<CustErr>) -> Self
Converts to this type from the input type.
source§impl<CustErr> From<ServerFnUrlError<CustErr>> for ServerFnErrorErr<CustErr>
impl<CustErr> From<ServerFnUrlError<CustErr>> for ServerFnErrorErr<CustErr>
source§fn from(error: ServerFnUrlError<CustErr>) -> Self
fn from(error: ServerFnUrlError<CustErr>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<CustErr> Freeze for ServerFnUrlError<CustErr>where
CustErr: Freeze,
impl<CustErr> RefUnwindSafe for ServerFnUrlError<CustErr>where
CustErr: RefUnwindSafe,
impl<CustErr> Send for ServerFnUrlError<CustErr>where
CustErr: Send,
impl<CustErr> Sync for ServerFnUrlError<CustErr>where
CustErr: Sync,
impl<CustErr> Unpin for ServerFnUrlError<CustErr>where
CustErr: Unpin,
impl<CustErr> UnwindSafe for ServerFnUrlError<CustErr>where
CustErr: UnwindSafe,
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
source§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.