pub enum TpmError {
BufferOverflow {
offset: usize,
needed: usize,
available: usize,
},
IntegerTooLarge {
offset: usize,
value: u64,
},
InvalidBoolean {
offset: usize,
value: u64,
},
InvalidCc {
offset: usize,
value: u64,
},
InvalidMagicNumber {
offset: usize,
value: u64,
},
InvalidRc {
offset: usize,
value: u64,
},
InvalidTag {
offset: usize,
value: u64,
},
TooManyBytes {
offset: usize,
limit: usize,
actual: usize,
},
TooManyItems {
offset: usize,
limit: usize,
actual: usize,
},
TrailingData {
offset: usize,
actual: usize,
},
UnexpectedEnd {
offset: usize,
needed: usize,
available: usize,
},
VariantNotAvailable {
offset: usize,
value: u64,
},
}Expand description
TPM frame marshaling and unmarshaling error type.
Every variant carries the byte offset from the start of the parsed buffer
along with the diagnostic counts relevant to that failure.
Variants§
BufferOverflow
Trying to marshal more bytes than buffer has space. This is unexpected situation, and should be considered possible bug in the crate itself.
Fields
IntegerTooLarge
Integer overflow while converting to an integer of a different size.
Fields
InvalidBoolean
Boolean value was expected but the value is neither 0 nor 1.
InvalidCc
Non-existent command code encountered.
Fields
InvalidMagicNumber
A TpmsAttest instance does not begin with
the TPM_GENERATED_VALUE magic.
Fields
InvalidRc
Invalid TPM response code encountered.
Fields
InvalidTag
Tag is neither Sessions nor
NoSessions.
TooManyBytes
Buffer contains more bytes than allowed by the TCG specifications.
Fields
TooManyItems
List contains more items than allowed by the TCG specifications.
Fields
TrailingData
Trailing data left after unmarshaling.
Fields
UnexpectedEnd
Run out of bytes while unmarshaling.
Fields
VariantNotAvailable
The variant accessed is not available.
Implementations§
Trait Implementations§
impl Copy for TpmError
Source§impl Display for TpmError
Renders TpmError as its bare variant name in lowercase, space-separated
words (e.g. BufferOverflow becomes buffer overflow).
impl Display for TpmError
Renders TpmError as its bare variant name in lowercase, space-separated
words (e.g. BufferOverflow becomes buffer overflow).
As the lowest-level crate in the stack, errors expose only the variant name
here, derived from the stable kind discriminant. Callers read
the structured fields directly and decide how to present the diagnostic
detail.
impl Eq for TpmError
Source§impl Error for TpmError
impl Error for TpmError
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()