pub struct TpmWire(/* private fields */);Expand description
A byte-backed TPM wire view.
Implementations§
Source§impl TpmWire
impl TpmWire
Sourcepub fn cast_prefix(buf: &[u8]) -> (&Self, &[u8])
pub fn cast_prefix(buf: &[u8]) -> (&Self, &[u8])
Casts a byte slice into a TPM wire view and returns no remainder.
Sourcepub fn cast_mut(buf: &mut [u8]) -> &mut Self
pub fn cast_mut(buf: &mut [u8]) -> &mut Self
Casts a mutable byte slice into a mutable TPM wire view.
Sourcepub fn cast_prefix_mut(buf: &mut [u8]) -> (&mut Self, &mut [u8])
pub fn cast_prefix_mut(buf: &mut [u8]) -> (&mut Self, &mut [u8])
Casts a mutable byte slice into a mutable TPM wire view and returns no remainder.
Sourcepub fn as_bytes_mut(&mut self) -> &mut [u8]
pub fn as_bytes_mut(&mut self) -> &mut [u8]
Returns the mutable backing bytes.
Source§impl TpmWire
impl TpmWire
Sourcepub unsafe fn cast_unchecked(buf: &[u8]) -> &Self
pub unsafe fn cast_unchecked(buf: &[u8]) -> &Self
Casts a byte slice into this wire view without validation.
§Safety
The caller must ensure buf satisfies every invariant required by
the checked constructors for this view.
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 this wire view without validation.
§Safety
The caller must ensure buf satisfies every invariant required by
the checked constructors for this view. The returned reference
inherits the exclusive access represented by buf.