Skip to main content

MeasurementMgr

Struct MeasurementMgr 

Source
pub struct MeasurementMgr { /* private fields */ }
Expand description

Responsible for storing all software components measurements and performing the read_measurement and extend_measurement functions.

Implementations§

Source§

impl MeasurementMgr

Source

pub fn init( boot_measurements: Vec<BootMeasurement>, ) -> Result<MeasurementMgr, MeasurementError>

Initializes with BootMeasurements repacked and stores as Measurement slots.

Source

pub fn read_measurement( &self, slot_id: usize, ) -> Result<(&Measurement, bool), MeasurementError>

Returns measurement metadata, value and locked attribute from given slot_id. Returns MeasurementError::InvalidArgument, when slot_id is out of bounds. Returns MeasurementError::DoesNotExist, when is not populated.

Source

pub fn extend_measurement( &mut self, slot_id: usize, measurement: Measurement, lock: bool, ) -> Result<(), MeasurementError>

Extends measurement with updated metadata, value and locked attribute in given slot_id. Returns MeasurementError::InvalidArgument, when slot_id is out of bounds. Returns MeasurementError::BadState, when measurement is locked. Returns MeasurementError::NotPermitted, when measurements signer id’s and algorithm do not match.

Trait Implementations§

Source§

impl Debug for MeasurementMgr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.