Trait TpmObject

Source
pub trait TpmObject: Any + Debug {
    // Required methods
    fn build(&self, writer: &mut TpmWriter<'_>) -> TpmResult<()>;
    fn len(&self) -> usize;
    fn as_any(&self) -> &dyn Any;
    fn dyn_eq(&self, other: &dyn TpmObject) -> bool;
}

Required Methods§

Source

fn build(&self, writer: &mut TpmWriter<'_>) -> TpmResult<()>

Builds the object into the given writer.

§Errors
  • TpmErrorKind::ValueTooLarge if the object contains a value that cannot be built.
  • TpmErrorKind::Boundary if the writer runs out of space.
Source

fn len(&self) -> usize

Returns the exact serialized size of the object.

Source

fn as_any(&self) -> &dyn Any

Returns the object as a &dyn Any for downcasting.

Source

fn dyn_eq(&self, other: &dyn TpmObject) -> bool

Performs a dynamic equality check against another TpmObject.

Implementors§

Source§

impl<T> TpmObject for T
where T: TpmBuild + TpmParse + PartialEq + Any + Debug,