pub struct FrameSet { /* private fields */ }
Expand description
A collection of Quil frames (DEFFRAME
instructions) with utility methods.
Implementations§
Source§impl FrameSet
impl FrameSet
pub fn new() -> Self
Sourcepub fn get(&self, identifier: &FrameIdentifier) -> Option<&FrameAttributes>
pub fn get(&self, identifier: &FrameIdentifier) -> Option<&FrameAttributes>
Retrieve the attributes of a frame by its identifier.
Sourcepub fn get_keys(&self) -> Vec<&FrameIdentifier>
pub fn get_keys(&self) -> Vec<&FrameIdentifier>
Return a list of all frame IDs described by this FrameSet.
Sourcepub fn insert(
&mut self,
identifier: FrameIdentifier,
attributes: FrameAttributes,
)
pub fn insert( &mut self, identifier: FrameIdentifier, attributes: FrameAttributes, )
Insert a new frame by ID, overwriting any existing one.
Sourcepub fn merge(&mut self, other: FrameSet)
pub fn merge(&mut self, other: FrameSet)
Merge another FrameSet with this one, overwriting any existing keys
Sourcepub fn intersection(&self, identifiers: &HashSet<&FrameIdentifier>) -> Self
pub fn intersection(&self, identifiers: &HashSet<&FrameIdentifier>) -> Self
Return a new FrameSet which describes only the given FrameIdentifiers.
Sourcepub fn iter(&self) -> Iter<'_, FrameIdentifier, FrameAttributes>
pub fn iter(&self) -> Iter<'_, FrameIdentifier, FrameAttributes>
Iterate through the contained frames.
Sourcepub fn into_instructions(self) -> Vec<Instruction>
pub fn into_instructions(self) -> Vec<Instruction>
Return the Quil instructions which describe the contained frames, consuming the FrameSet
.
Sourcepub fn to_instructions(&self) -> Vec<Instruction>
pub fn to_instructions(&self) -> Vec<Instruction>
Return the Quil instructions which describe the contained frames.
Trait Implementations§
impl Eq for FrameSet
impl StructuralPartialEq for FrameSet
Auto Trait Implementations§
impl Freeze for FrameSet
impl RefUnwindSafe for FrameSet
impl Send for FrameSet
impl Sync for FrameSet
impl Unpin for FrameSet
impl UnwindSafe for FrameSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.