#[non_exhaustive]pub enum BlockValidationError {
Bytesrepr(Error),
UnexpectedBlockHash {
block: Box<Block>,
actual_block_hash: BlockHash,
},
UnexpectedBodyHash {
block: Box<Block>,
actual_block_body_hash: Digest,
},
IncompatibleVersions,
}
Expand description
An error that can arise when validating a block’s cryptographic integrity using its hashes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Bytesrepr(Error)
Problem serializing some of a block’s data into bytes.
UnexpectedBlockHash
The provided block’s hash is not the same as the actual hash of the block.
Fields
UnexpectedBodyHash
The body hash in the header is not the same as the actual hash of the body of the block.
Fields
IncompatibleVersions
The header version does not match the body version.
Trait Implementations§
Source§impl Clone for BlockValidationError
impl Clone for BlockValidationError
Source§fn clone(&self) -> BlockValidationError
fn clone(&self) -> BlockValidationError
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 DataSize for BlockValidationError
impl DataSize for BlockValidationError
Source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
If
true
, the type has a heap size that can vary at runtime, depending on the actual value.Source§const STATIC_HEAP_SIZE: usize = 0usize
const STATIC_HEAP_SIZE: usize = 0usize
The amount of space a value of the type always occupies. If
IS_DYNAMIC
is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.Source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Estimates the size of heap memory taken up by this value. Read more
Source§impl Debug for BlockValidationError
impl Debug for BlockValidationError
Source§impl Display for BlockValidationError
impl Display for BlockValidationError
Source§impl Error for BlockValidationError
Available on crate feature std
only.
impl Error for BlockValidationError
Available on crate feature
std
only.Source§fn source(&self) -> Option<&(dyn StdError + 'static)>
fn source(&self) -> Option<&(dyn StdError + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<Error> for BlockValidationError
impl From<Error> for BlockValidationError
Source§impl PartialEq for BlockValidationError
impl PartialEq for BlockValidationError
Source§impl Serialize for BlockValidationError
impl Serialize for BlockValidationError
impl Eq for BlockValidationError
impl StructuralPartialEq for BlockValidationError
Auto Trait Implementations§
impl Freeze for BlockValidationError
impl RefUnwindSafe for BlockValidationError
impl Send for BlockValidationError
impl Sync for BlockValidationError
impl Unpin for BlockValidationError
impl UnwindSafe for BlockValidationError
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> 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<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 more