pub struct InvalidCompactTargetError(/* private fields */);Expand description
Error returned when a compact target is negative or overflows 256 bits.
Implementations§
Source§impl InvalidCompactTargetError
impl InvalidCompactTargetError
Sourcepub fn invalid_compact(&self) -> CompactTarget
pub fn invalid_compact(&self) -> CompactTarget
Returns the compact value that failed to convert.
Sourcepub fn invalid_target(&self) -> Target
pub fn invalid_target(&self) -> Target
Returns the target as Bitcoin Core decodes it, ignoring the error.
ref: https://github.com/bitcoin/bitcoin/blob/830583eb9d07e054c54a177907a98153ab3e29ae/src/pow.cpp#L64
Trait Implementations§
Source§impl Clone for InvalidCompactTargetError
impl Clone for InvalidCompactTargetError
Source§impl Debug for InvalidCompactTargetError
impl Debug for InvalidCompactTargetError
Source§impl Display for InvalidCompactTargetError
impl Display for InvalidCompactTargetError
impl Eq for InvalidCompactTargetError
Source§impl Error for InvalidCompactTargetError
Available on crate feature std only.
impl Error for InvalidCompactTargetError
Available on crate feature
std only.Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + '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<!> for InvalidCompactTargetError
impl From<!> for InvalidCompactTargetError
Source§fn from(never: Infallible) -> Self
fn from(never: Infallible) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for InvalidCompactTargetError
Auto Trait Implementations§
impl Freeze for InvalidCompactTargetError
impl RefUnwindSafe for InvalidCompactTargetError
impl Send for InvalidCompactTargetError
impl Sync for InvalidCompactTargetError
impl Unpin for InvalidCompactTargetError
impl UnsafeUnpin for InvalidCompactTargetError
impl UnwindSafe for InvalidCompactTargetError
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