pub struct CalibrationSet<T> { /* private fields */ }
Expand description
A CalibrationSet
is a collection of calibration instructions that respect how
calibrations work in a Quil program.
During calibration expansion, Calibrations are matched to instructions using their unique
CalibrationSignature
. This means only one calibration can be matched to a particular
instruction. While the Quil specification doesn’t explicitly define the behavior of
signature conflicts, CalibrationSet
takes the liberty of only allowing one calibration
per CalibrationSignature
.
Calibrations maintain insertion order
Implementations§
Source§impl<T> CalibrationSet<T>where
T: CalibrationSignature,
impl<T> CalibrationSet<T>where
T: CalibrationSignature,
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a [InnerCalibrationSet
] with the specified capacity.
Sourcepub fn get(
&self,
signature: &<T as CalibrationSignature>::Signature<'_>,
) -> Option<&T>
pub fn get( &self, signature: &<T as CalibrationSignature>::Signature<'_>, ) -> Option<&T>
Get a reference to a value that has a matching signature, if it exists.
Sourcepub fn replace(&mut self, value: T) -> Option<T>
pub fn replace(&mut self, value: T) -> Option<T>
Adds a value to the set, replacing and returning an existing value with a matching
CalibrationSignature
, if it exists.
Sourcepub fn remove(
&mut self,
signature: &<T as CalibrationSignature>::Signature<'_>,
) -> bool
pub fn remove( &mut self, signature: &<T as CalibrationSignature>::Signature<'_>, ) -> bool
Removes a value from the set. Returns whether the value was present in the set.
Trait Implementations§
Source§impl<T: Clone> Clone for CalibrationSet<T>
impl<T: Clone> Clone for CalibrationSet<T>
Source§fn clone(&self) -> CalibrationSet<T>
fn clone(&self) -> CalibrationSet<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<T: Debug> Debug for CalibrationSet<T>
impl<T: Debug> Debug for CalibrationSet<T>
Source§impl<T> Default for CalibrationSet<T>where
T: CalibrationSignature,
impl<T> Default for CalibrationSet<T>where
T: CalibrationSignature,
Source§impl<T> Extend<T> for CalibrationSet<T>where
T: CalibrationSignature,
impl<T> Extend<T> for CalibrationSet<T>where
T: CalibrationSignature,
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = T>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl<T> From<Vec<T>> for CalibrationSet<T>where
T: CalibrationSignature,
impl<T> From<Vec<T>> for CalibrationSet<T>where
T: CalibrationSignature,
Source§impl<T> IntoIterator for CalibrationSet<T>
impl<T> IntoIterator for CalibrationSet<T>
Source§impl<T: PartialEq> PartialEq for CalibrationSet<T>
impl<T: PartialEq> PartialEq for CalibrationSet<T>
impl<T> StructuralPartialEq for CalibrationSet<T>
Auto Trait Implementations§
impl<T> Freeze for CalibrationSet<T>
impl<T> RefUnwindSafe for CalibrationSet<T>where
T: RefUnwindSafe,
impl<T> Send for CalibrationSet<T>where
T: Send,
impl<T> Sync for CalibrationSet<T>where
T: Sync,
impl<T> Unpin for CalibrationSet<T>where
T: Unpin,
impl<T> UnwindSafe for CalibrationSet<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.