#[non_exhaustive]pub enum Error {
Show 15 variants
MessageTooShort,
NoTags,
InvalidOffsets,
MissingTag(u32),
InvalidFieldSize(u32),
InvalidPublicKeyEncoding,
SignatureInvalid,
DelegationNotValidAtMidpoint,
InvalidMerklePathLength,
MerkleRootMismatch,
MerkleIndexOutOfBounds,
BeforeFloor {
candidate_secs: u64,
floor_secs: u64,
},
NoValidResponses,
ClockUnavailable(ClockError),
RandomUnavailable,
}Expand description
Errors produced by this crate.
Deliberately structured (rather than string-based) so error paths never need to allocate.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MessageTooShort
The message was too short to contain a valid header.
NoTags
The message declared zero tags, which is not a valid Roughtime message.
InvalidOffsets
A tag offset was out of bounds, decreasing, or not a multiple of 4.
MissingTag(u32)
A required tag was missing from a parsed message.
InvalidFieldSize(u32)
A tag’s value had the wrong size for its expected type.
InvalidPublicKeyEncoding
A base64-encoded public key failed to decode.
SignatureInvalid
An Ed25519 signature failed to verify.
DelegationNotValidAtMidpoint
The delegated key’s validity interval (MINT..=MAXT) does not contain the response’s
reported midpoint.
InvalidMerklePathLength
The Merkle inclusion proof’s PATH length was not a multiple of 32 bytes.
MerkleRootMismatch
The computed Merkle root did not match the server’s reported ROOT.
MerkleIndexOutOfBounds
The Merkle index was not fully consumed by the proof (index too large for the path depth).
BeforeFloor
A verified time was earlier than the crate’s anti-rollback floor.
Fields
NoValidResponses
No valid responses were received from any queried server.
The system clock could not be read or set.
A cryptographically secure random-number source was unavailable.
Trait Implementations§
impl Copy for Error
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()