pub struct CapturedError { /* private fields */ }
Expand description
An instance of an error captured by a descendant component.
Implementations§
Source§impl CapturedError
impl CapturedError
Sourcepub fn new(error: impl AnyError + 'static) -> CapturedError
pub fn new(error: impl AnyError + 'static) -> CapturedError
Create a new captured error
Sourcepub fn from_display(error: impl Display + 'static) -> CapturedError
pub fn from_display(error: impl Display + 'static) -> CapturedError
Create a new error from a type that only implements Display
. If your type implements Error
, you can use CapturedError::from
instead.
Sourcepub fn with_origin(self, scope: ScopeId) -> CapturedError
pub fn with_origin(self, scope: ScopeId) -> CapturedError
Mark the error as being thrown from a specific scope
Trait Implementations§
Source§impl Clone for CapturedError
impl Clone for CapturedError
Source§fn clone(&self) -> CapturedError
fn clone(&self) -> CapturedError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T> Context<T, CapturedError> for Option<T>
impl<T> Context<T, CapturedError> for Option<T>
Source§fn show(
self,
display_error: impl FnOnce(&CapturedError) -> Result<VNode, RenderError>,
) -> Result<T, CapturedError>
fn show( self, display_error: impl FnOnce(&CapturedError) -> Result<VNode, RenderError>, ) -> Result<T, CapturedError>
Add a visual representation of the error that the
ErrorBoundary
may render Read moreSource§fn context<C>(self, context: C) -> Result<T, CapturedError>where
C: Display + 'static,
fn context<C>(self, context: C) -> Result<T, CapturedError>where
C: Display + 'static,
Wrap the result additional context about the error that occurred. Read more
Source§fn with_context<C>(
self,
context: impl FnOnce() -> C,
) -> Result<T, CapturedError>where
C: Display + 'static,
fn with_context<C>(
self,
context: impl FnOnce() -> C,
) -> Result<T, CapturedError>where
C: Display + 'static,
Wrap the result with additional context about the error that occurred. The closure will only be run if the Result is an error. Read more
Source§impl Debug for CapturedError
impl Debug for CapturedError
Source§impl<'de> Deserialize<'de> for CapturedError
impl<'de> Deserialize<'de> for CapturedError
Source§fn deserialize<D>(
deserializer: D,
) -> Result<CapturedError, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<CapturedError, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for CapturedError
impl Display for CapturedError
Source§impl From<CapturedError> for RenderError
impl From<CapturedError> for RenderError
Source§fn from(e: CapturedError) -> RenderError
fn from(e: CapturedError) -> RenderError
Converts to this type from the input type.
Source§impl<E> From<E> for CapturedErrorwhere
E: AnyError + 'static,
impl<E> From<E> for CapturedErrorwhere
E: AnyError + 'static,
Source§fn from(error: E) -> CapturedError
fn from(error: E) -> CapturedError
Converts to this type from the input type.
Source§impl FromStr for CapturedError
impl FromStr for CapturedError
Source§type Err = Infallible
type Err = Infallible
The associated error which can be returned from parsing.
Source§fn from_str(s: &str) -> Result<CapturedError, <CapturedError as FromStr>::Err>
fn from_str(s: &str) -> Result<CapturedError, <CapturedError as FromStr>::Err>
Parses a string
s
to return a value of this type. Read moreSource§impl PartialEq for CapturedError
impl PartialEq for CapturedError
Source§impl Serialize for CapturedError
impl Serialize for CapturedError
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl !Freeze for CapturedError
impl !RefUnwindSafe for CapturedError
impl !Send for CapturedError
impl !Sync for CapturedError
impl Unpin for CapturedError
impl !UnwindSafe for CapturedError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromRouteSegment for T
impl<T> FromRouteSegment for T
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<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
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.
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.