pub enum CursorError {
Expired,
InvalidSignature,
Format(String),
TooLarge(usize),
OpaqueStateTooLarge(usize),
}Expand description
Errors from cursor issue / verify operations.
Variants§
Expired
Cursor’s issued_at_unix is older than ttl_seconds, or its
server_session doesn’t match the current issuer (server restarted).
Maps to ERR_CURSOR_EXPIRED on the wire.
InvalidSignature
HMAC verification failed AND the cursor’s embedded server_session
matches the current issuer’s nonce. This narrows the cause to real
forgery / tampering: an attacker constructed a body whose nonce
happened to match (or, with probability 2⁻⁶⁴, key rotation that
preserved the nonce). Maps to ERR_CURSOR_INVALID on the wire —
adopters should surface as a security signal.
Server restart (random key AND random nonce both rotated) is the
expected lifecycle of single-instance deployments and is reported
as Self::Expired instead, so adopters can transparently drop
the persisted cursor and re-issue.
Format(String)
Malformed encoding (bad base64, bad CBOR). Maps to ERR_CURSOR_INVALID.
TooLarge(usize)
Encoded cursor exceeds MAX_CURSOR_BYTES. Returned only on issue
(verify checks the same cap before decoding).
OpaqueStateTooLarge(usize)
opaque_state exceeds MAX_OPAQUE_STATE_BYTES. Caught at issue
time so a tool can’t accidentally embed a 1MB blob.
Trait Implementations§
Source§impl Debug for CursorError
impl Debug for CursorError
Source§impl Display for CursorError
impl Display for CursorError
Source§impl Error for CursorError
impl Error for CursorError
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()