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>,
) -> ServerFnUrlError<CustErr>
pub fn new( path: impl Display, error: ServerFnError<CustErr>, ) -> ServerFnUrlError<CustErr>
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 for ServerFnUrlError<CustErr>where
CustErr: Debug,
impl<CustErr> Debug for ServerFnUrlError<CustErr>where
CustErr: Debug,
Source§impl<CustErr> From<ServerFnUrlError<CustErr>> for ServerFnError<CustErr>
impl<CustErr> From<ServerFnUrlError<CustErr>> for ServerFnError<CustErr>
Source§fn from(error: ServerFnUrlError<CustErr>) -> ServerFnError<CustErr>
fn from(error: ServerFnUrlError<CustErr>) -> ServerFnError<CustErr>
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>) -> ServerFnErrorErr<CustErr>
fn from(error: ServerFnUrlError<CustErr>) -> ServerFnErrorErr<CustErr>
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> 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.