pub struct TpmInt8(/* private fields */);Implementations§
Source§impl TpmInt8
impl TpmInt8
pub const fn new(value: i8) -> Self
pub const fn value(self) -> i8
pub const fn get(&self) -> i8
pub const fn set(&mut self, value: i8)
pub const fn as_bytes(&self) -> &[u8; 1]
pub fn as_bytes_mut(&mut self) -> &mut [u8; 1]
pub fn to_be_bytes(self) -> [u8; 1]
pub const fn from_be_bytes(bytes: [u8; 1]) -> Self
Sourcepub fn cast(buf: &[u8]) -> TpmResult<&Self>
pub fn cast(buf: &[u8]) -> TpmResult<&Self>
Casts a byte slice into a TPM integer wire view.
§Errors
Returns UnexpectedEnd when
buf is smaller than this integer’s wire size.
Returns TrailingData when
buf is larger than this integer’s wire size.
Sourcepub unsafe fn cast_unchecked(buf: &[u8]) -> &Self
pub unsafe fn cast_unchecked(buf: &[u8]) -> &Self
Casts a byte slice into a TPM integer wire view without validation.
§Safety
The caller must ensure that buf.len() equals this integer’s
wire size and that any containing protocol structure has been
validated as needed.
Sourcepub fn cast_mut(buf: &mut [u8]) -> TpmResult<&mut Self>
pub fn cast_mut(buf: &mut [u8]) -> TpmResult<&mut Self>
Casts a mutable byte slice into a mutable TPM integer wire view.
§Errors
Returns UnexpectedEnd when
buf is smaller than this integer’s wire size.
Returns TrailingData when
buf is larger than this integer’s wire size.
Sourcepub unsafe fn cast_mut_unchecked(buf: &mut [u8]) -> &mut Self
pub unsafe fn cast_mut_unchecked(buf: &mut [u8]) -> &mut Self
Casts a mutable byte slice into a mutable TPM integer wire view without validation.
§Safety
The caller must ensure that buf.len() equals this integer’s
wire size and that any containing protocol structure has been
validated as needed. The returned reference inherits the
exclusive access represented by buf.