pub trait TpmCastMut: TpmCast {
// Required methods
fn cast_mut(buf: &mut [u8]) -> TpmResult<&mut Self>;
unsafe fn cast_mut_unchecked(buf: &mut [u8]) -> &mut Self;
}Expand description
Casts caller-owned mutable bytes into a mutable TPM wire view.
Required Methods§
Sourcefn cast_mut(buf: &mut [u8]) -> TpmResult<&mut Self>
fn cast_mut(buf: &mut [u8]) -> TpmResult<&mut Self>
Casts buf into mutable Self after validating the wire-view invariants.
§Errors
Returns Err(TpmError) when buf does not satisfy the
invariants for Self.
Sourceunsafe fn cast_mut_unchecked(buf: &mut [u8]) -> &mut Self
unsafe fn cast_mut_unchecked(buf: &mut [u8]) -> &mut Self
Casts buf into mutable Self without validating the wire-view invariants.
§Safety
The caller must ensure that buf satisfies the same invariants checked
by TpmCastMut::cast_mut. The returned reference inherits the
exclusive access represented by buf.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".