Skip to main content

TpmsKeyedhashParmsWire

Struct TpmsKeyedhashParmsWire 

Source
pub struct TpmsKeyedhashParmsWire(/* private fields */);

Implementations§

Source§

impl TpmsKeyedhashParmsWire

Source

pub fn cast(buf: &[u8]) -> TpmResult<&Self>
where TpmtKeyedhashScheme: for<'a> TpmField<'a>,

Casts bytes into a typed wire structure view.

§Errors

Returns Err(TpmError) when buf is not exactly one valid wire structure.

Source

pub fn cast_prefix(buf: &[u8]) -> TpmResult<(&Self, &[u8])>
where TpmtKeyedhashScheme: for<'a> TpmField<'a>,

Casts the first typed wire structure from buf and returns the remainder.

§Errors

Returns Err(TpmError) when buf does not start with a valid wire structure.

Source

pub unsafe fn cast_unchecked(buf: &[u8]) -> &Self

Casts bytes into a typed wire structure view without validation.

§Safety

The caller must ensure buf is exactly one valid wire structure.

Source

pub const fn as_bytes(&self) -> &[u8]

Returns the complete wire structure bytes.

Source

pub fn validate(buf: &[u8]) -> TpmResult<()>
where TpmtKeyedhashScheme: for<'a> TpmField<'a>,

Validates an exact typed wire structure view.

§Errors

Returns Err(TpmError) when buf is not exactly one valid wire structure.

Source

pub fn validate_prefix(buf: &[u8]) -> TpmResult<usize>
where TpmtKeyedhashScheme: for<'a> TpmField<'a>,

Validates a typed wire structure prefix.

§Errors

Returns Err(TpmError) when buf does not start with a valid wire structure.

Source

pub fn scheme(&self) -> TpmResult<&TpmtKeyedhashScheme>
where TpmtKeyedhashScheme: for<'a> TpmField<'a, View = &'a TpmtKeyedhashScheme>,

Returns a borrowed field view.

§Errors

Returns Err(TpmError) when preceding fields or this field are malformed.

Trait Implementations§

Source§

impl AsRef<[u8]> for TpmsKeyedhashParmsWire

Source§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more