pub struct TpmWire(/* private fields */);Expand description
A byte-backed TPM wire view.
Implementations§
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 a TPM wire view without validation.
§Safety
TpmWire has no additional validity requirements beyond the validity
of buf. Callers must still ensure any higher-level protocol
invariants required by later typed accessors have been validated.
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 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 wire view without validation.
§Safety
TpmWire has no additional validity requirements beyond the validity
of buf. Callers must still ensure any higher-level protocol
invariants required by later typed accessors have been validated. The
returned reference inherits the exclusive access represented by buf.
Sourcepub fn as_bytes_mut(&mut self) -> &mut [u8]
pub fn as_bytes_mut(&mut self) -> &mut [u8]
Returns the mutable backing bytes.