[−][src]Struct tss_esapi::utils::PcrSelections
A struct representing pcr selections
The minimum number of octets allowed in a TPMS_PCR_SELECT.sizeOfSelect is not determined by the number of PCR implemented but by the number of PCR required by the platform-specific specification with which the TPM is compliant or by the implementer if not adhering to a platform-specific specification.
Implementations
impl PcrSelections
[src]
pub fn len(&self) -> usize
[src]
Function for retrieiving the number of banks in the selection
pub fn is_empty(&self) -> bool
[src]
Returns true if the selection is empty.
pub fn subtract(&mut self, other: &Self) -> Result<()>
[src]
Removes items in other
from `self.
Arguments
other
- A PcrSelections containing items that will be removed fromself
.
Constraints
-
Cannot be called with
other
that contains items that are not present inself
. -
Cannot be called with
other
that has a size_of_select that is different from the one inself
.
Errors
-
Calling the method with
other
that contains items not present inself
will result in an InvalidParam error. -
Calling the method with
other
that contains a size_of_select that is different then the one inself
will result in a InvalidParam error.
Examples
use tss_esapi::utils::{PcrSelectionsBuilder, PcrSlot, algorithm_specifiers::HashingAlgorithm}; // pcr selections let mut pcr_selections = PcrSelectionsBuilder::new() .with_size_of_select(Default::default()) .with_selection(HashingAlgorithm::Sha256, &[PcrSlot::Slot0, PcrSlot::Slot8]) .build(); // Another pcr selections let other = PcrSelectionsBuilder::new() .with_size_of_select(Default::default()) .with_selection( HashingAlgorithm::Sha256, &[PcrSlot::Slot0], ) .build(); pcr_selections.subtract(&other).unwrap(); assert_eq!(pcr_selections.len(), 1);
Trait Implementations
impl Clone for PcrSelections
[src]
fn clone(&self) -> PcrSelections
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PcrSelections
[src]
impl Default for PcrSelections
[src]
fn default() -> PcrSelections
[src]
impl Eq for PcrSelections
[src]
impl From<PcrSelections> for TPML_PCR_SELECTION
[src]
fn from(pcr_selections: PcrSelections) -> TPML_PCR_SELECTION
[src]
impl PartialEq<PcrSelections> for PcrSelections
[src]
fn eq(&self, other: &PcrSelections) -> bool
[src]
fn ne(&self, other: &PcrSelections) -> bool
[src]
impl StructuralEq for PcrSelections
[src]
impl StructuralPartialEq for PcrSelections
[src]
impl TryFrom<TPML_PCR_SELECTION> for PcrSelections
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(tpml_pcr_selection: TPML_PCR_SELECTION) -> Result<PcrSelections>
[src]
Auto Trait Implementations
impl RefUnwindSafe for PcrSelections
impl Send for PcrSelections
impl Sync for PcrSelections
impl Unpin for PcrSelections
impl UnwindSafe for PcrSelections
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Free for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,