pub enum SubscanError {
ModuleError(ModuleErrorKind),
}Expand description
Subscan error variants
Variants§
ModuleError(ModuleErrorKind)
Module error, see ModuleErrorKind for generic error definitions
Implementations§
Source§impl SubscanError
impl SubscanError
Sourcepub fn status(&self) -> SubscanModuleStatus
pub fn status(&self) -> SubscanModuleStatus
Get SubscanModuleStatus type
§Examples
use subscan::error::{SubscanError, ModuleErrorKind::Custom};
let failed = SubscanError::from(Custom("foo".into()));
assert_eq!(failed.status(), Custom("foo".into()).into());
assert_eq!(format!("{failed}"), "foo");Sourcepub fn stats(&self) -> SubscanModuleStatistic
pub fn stats(&self) -> SubscanModuleStatistic
Get SubscanModuleStatistic from any SubscanError
§Examples
use subscan::error::{SubscanError, ModuleErrorKind::Custom};
use subscan::types::result::status::SkipReason::SkippedByUser;
let failed = SubscanError::from(SkippedByUser);
let stats = failed.stats();
assert_eq!(stats.status, SkippedByUser.into());
assert_eq!(stats.count, 0);
assert_eq!(stats.elapsed.num_seconds(), 0);Trait Implementations§
Source§impl Clone for SubscanError
impl Clone for SubscanError
Source§fn clone(&self) -> SubscanError
fn clone(&self) -> SubscanError
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 Debug for SubscanError
impl Debug for SubscanError
Source§impl Display for SubscanError
impl Display for SubscanError
Source§impl From<Error> for SubscanError
impl From<Error> for SubscanError
Source§impl From<Error> for SubscanError
impl From<Error> for SubscanError
Source§impl From<ModuleErrorKind> for SubscanError
impl From<ModuleErrorKind> for SubscanError
Source§fn from(value: ModuleErrorKind) -> Self
fn from(value: ModuleErrorKind) -> Self
Converts to this type from the input type.
Source§impl From<ParseError> for SubscanError
impl From<ParseError> for SubscanError
Source§fn from(value: ParseError) -> Self
fn from(value: ParseError) -> Self
Converts to this type from the input type.
Source§impl From<SelectorErrorKind<'_>> for SubscanError
impl From<SelectorErrorKind<'_>> for SubscanError
Source§fn from(value: SelectorErrorKind<'_>) -> Self
fn from(value: SelectorErrorKind<'_>) -> Self
Converts to this type from the input type.
Source§impl From<SkipReason> for SubscanError
impl From<SkipReason> for SubscanError
Source§fn from(value: SkipReason) -> Self
fn from(value: SkipReason) -> Self
Converts to this type from the input type.
Source§impl From<SubscanError> for SubscanModuleStatus
impl From<SubscanError> for SubscanModuleStatus
Source§fn from(err: SubscanError) -> Self
fn from(err: SubscanError) -> Self
Converts to this type from the input type.
Source§impl Ord for SubscanError
impl Ord for SubscanError
Source§fn cmp(&self, other: &SubscanError) -> Ordering
fn cmp(&self, other: &SubscanError) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for SubscanError
impl PartialEq for SubscanError
Source§impl PartialOrd for SubscanError
impl PartialOrd for SubscanError
impl Eq for SubscanError
impl StructuralPartialEq for SubscanError
Auto Trait Implementations§
impl Freeze for SubscanError
impl RefUnwindSafe for SubscanError
impl Send for SubscanError
impl Sync for SubscanError
impl Unpin for SubscanError
impl UnsafeUnpin for SubscanError
impl UnwindSafe for SubscanError
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
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.