pub enum HeaderErrorKind {
InvalidParent,
Pow,
Timestamp,
Number,
Epoch,
Version,
}
Expand description
A list specifying categories of ckb header error.
This list is intended to grow over time and it is not recommended to exhaustively match against it.
It is used with the HeaderError
.
Variants§
InvalidParent
It indicates that the underlying error is InvalidParentError
.
Pow
It indicates that the underlying error is PowError
.
Timestamp
It indicates that the underlying error is TimestampError
.
Number
It indicates that the underlying error is NumberError
.
Epoch
It indicates that the underlying error is EpochError
.
Version
It indicates that the underlying error is BlockVersionError
.
Implementations§
Source§impl HeaderErrorKind
impl HeaderErrorKind
Sourcepub fn because<E>(self, reason: E) -> HeaderError
pub fn because<E>(self, reason: E) -> HeaderError
Creates HeaderError
base on HeaderErrorKind
with an error as the reason.
Sourcepub fn other<T>(self, reason: T) -> HeaderErrorwhere
T: Display,
pub fn other<T>(self, reason: T) -> HeaderErrorwhere
T: Display,
Creates HeaderError
base on HeaderErrorKind
with a simple string as the reason.
Trait Implementations§
Source§impl Clone for HeaderErrorKind
impl Clone for HeaderErrorKind
Source§fn clone(&self) -> HeaderErrorKind
fn clone(&self) -> HeaderErrorKind
Returns a copy 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 HeaderErrorKind
impl Debug for HeaderErrorKind
Source§impl Display for HeaderErrorKind
impl Display for HeaderErrorKind
Source§impl From<HeaderErrorKind> for Error
impl From<HeaderErrorKind> for Error
Source§fn from(error: HeaderErrorKind) -> Self
fn from(error: HeaderErrorKind) -> Self
Converts to this type from the input type.
Source§impl From<HeaderErrorKind> for HeaderError
impl From<HeaderErrorKind> for HeaderError
Source§fn from(kind: HeaderErrorKind) -> Self
fn from(kind: HeaderErrorKind) -> Self
Converts to this type from the input type.
Source§impl PartialEq for HeaderErrorKind
impl PartialEq for HeaderErrorKind
impl Copy for HeaderErrorKind
impl Eq for HeaderErrorKind
impl StructuralPartialEq for HeaderErrorKind
Auto Trait Implementations§
impl Freeze for HeaderErrorKind
impl RefUnwindSafe for HeaderErrorKind
impl Send for HeaderErrorKind
impl Sync for HeaderErrorKind
impl Unpin for HeaderErrorKind
impl UnwindSafe for HeaderErrorKind
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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 more