Struct tss_esapi::structures::pcr_selection_list::PcrSelectionList [−][src]
A struct representing a pcr selection list. This corresponds to the TSS TPML_PCR_SELECTION.
Implementations
impl PcrSelectionList
[src]
pub const MAX_SIZE: usize
[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 list_from_option(pcr_list: Option<PcrSelectionList>) -> PcrSelectionList
[src]
Function for retrieving the PcrSelectionList from Option
This returns an empty list if None is passed
pub fn subtract(&mut self, other: &Self) -> Result<()>
[src]
Removes items in other
from `self.
Arguments
other
- A PcrSelectionList 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 contains pcr selection associated with a hashing algorithm that cannot be subtracted from the pcr selection associated with the same hashing algorithm inself
.
Errors
- Calling the method with
other
that contains items not present inself
will result in an InvalidParam error.
Examples
use tss_esapi::structures::{PcrSelectionListBuilder, PcrSlot}; use tss_esapi::interface_types::algorithm::HashingAlgorithm; // pcr selections let mut pcr_selection_list = PcrSelectionListBuilder::new() .with_size_of_select(Default::default()) .with_selection(HashingAlgorithm::Sha256, &[PcrSlot::Slot0, PcrSlot::Slot8]) .build(); // Another pcr selections let other = PcrSelectionListBuilder::new() .with_size_of_select(Default::default()) .with_selection( HashingAlgorithm::Sha256, &[PcrSlot::Slot0], ) .build(); pcr_selection_list.subtract(&other).unwrap(); assert_eq!(pcr_selection_list.len(), 1);
Trait Implementations
impl Clone for PcrSelectionList
[src]
fn clone(&self) -> PcrSelectionList
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PcrSelectionList
[src]
impl Eq for PcrSelectionList
[src]
impl PartialEq<PcrSelectionList> for PcrSelectionList
[src]
fn eq(&self, other: &PcrSelectionList) -> bool
[src]
fn ne(&self, other: &PcrSelectionList) -> bool
[src]
impl StructuralEq for PcrSelectionList
[src]
impl StructuralPartialEq for PcrSelectionList
[src]
impl TryFrom<TPML_PCR_SELECTION> for PcrSelectionList
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(tpml_pcr_selection: TPML_PCR_SELECTION) -> Result<PcrSelectionList>
[src]
Auto Trait Implementations
impl RefUnwindSafe for PcrSelectionList
impl Send for PcrSelectionList
impl Sync for PcrSelectionList
impl Unpin for PcrSelectionList
impl UnwindSafe for PcrSelectionList
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,