#[non_exhaustive]pub enum MineError {
Clock(TimestampError),
Builder(EventBuilderError),
NonceExhausted,
}Expand description
Errors raised by mine / mine_and_sign.
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.
Clock(TimestampError)
The wall clock could not be read.
Builder(EventBuilderError)
Forwarded from event signing.
NonceExhausted
The nonce search exhausted the full u64 space without finding a
matching id at the requested difficulty.
In practice unreachable for any real-world difficulty; the variant
exists so the mining loop never silently saturates and never spins
forever. Callers may recover by re-mining with a different
created_at (NIP-13 explicitly suggests refreshing it).
Trait Implementations§
Source§impl Error for MineError
impl Error for MineError
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<EventBuilderError> for MineError
impl From<EventBuilderError> for MineError
Source§fn from(source: EventBuilderError) -> Self
fn from(source: EventBuilderError) -> Self
Converts to this type from the input type.
Source§impl From<TimestampError> for MineError
impl From<TimestampError> for MineError
Source§fn from(source: TimestampError) -> Self
fn from(source: TimestampError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MineError
impl RefUnwindSafe for MineError
impl Send for MineError
impl Sync for MineError
impl Unpin for MineError
impl UnsafeUnpin for MineError
impl UnwindSafe for MineError
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