#[non_exhaustive]pub enum Error {
Timeout(ErrorContext),
Crc(ErrorContext),
NoCard,
UnsupportedCommand,
BadResponse(ErrorContext),
CardError(CardError),
WriteError(ErrorContext),
ReadError(ErrorContext),
Misaligned,
InvalidArgument,
CardLocked,
BusError(ErrorContext),
}Expand description
Errors returned by SD/MMC protocol parsers and drivers.
Recoverable bus / protocol variants carry an ErrorContext pinpointing
the phase and (when known) command index that raised them. Caller-facing
programming errors (Misaligned, InvalidArgument) and card-state
reports (NoCard, CardError, CardLocked) do not.
Marked #[non_exhaustive]: more variants (e.g. NoCardDetected,
VoltageSwitchFailed, retry-exhausted) are expected before 1.0. Match
sites in downstream crates must keep a _ => ... arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Timeout(ErrorContext)
No response from card within the deadline for the wrapped phase.
Crc(ErrorContext)
CRC check failed during the wrapped phase.
NoCard
Card is not responding or not inserted.
UnsupportedCommand
Command index is not supported on this transport.
BadResponse(ErrorContext)
Bad response received during the wrapped phase.
CardError(CardError)
Card returned an error in its R1 response.
WriteError(ErrorContext)
Write operation failed during the wrapped phase.
ReadError(ErrorContext)
Read operation failed during the wrapped phase.
Misaligned
Misaligned address or length passed by the caller.
InvalidArgument
Caller passed an invalid argument.
CardLocked
Card is locked (host needs to unlock before further I/O).
BusError(ErrorContext)
Generic communication error on the bus during the wrapped phase.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()