pub struct QirLabeledFormatter;Expand description
Formatter for QIR Output Spec results.
Implementations§
Source§impl QirLabeledFormatter
impl QirLabeledFormatter
Sourcepub fn _val_null(&self, tag: Option<&str>, val: &QsysShotItemValue) -> bool
pub fn _val_null(&self, tag: Option<&str>, val: &QsysShotItemValue) -> bool
No null tags or null values allowed (empty strings permitted for tags)
Sourcepub fn _val_tag_type(&self, tag: Option<&str>, _val: &QsysShotItemValue) -> bool
pub fn _val_tag_type(&self, tag: Option<&str>, _val: &QsysShotItemValue) -> bool
Tag must be a string
Sourcepub fn validate_tag_and_value(
&self,
tag: Option<&str>,
val: &QsysShotItemValue,
) -> bool
pub fn validate_tag_and_value( &self, tag: Option<&str>, val: &QsysShotItemValue, ) -> bool
Ensure the tag and value are valid values
Sourcepub fn results_header(&self, qo: &mut QirOutput)
pub fn results_header(&self, qo: &mut QirOutput)
Emit results header.
Sourcepub fn first_shot_header(&self, qo: &mut QirOutput, attributes: &QirMetadata)
pub fn first_shot_header(&self, qo: &mut QirOutput, attributes: &QirMetadata)
Emit opening shot boundary header.
Emit closing shot boundary footer.
Sourcepub fn format_value(
&self,
type_str: &str,
val: &QsysShotItemValue,
) -> FormattedValue
pub fn format_value( &self, type_str: &str, val: &QsysShotItemValue, ) -> FormattedValue
Format the value if required
Sourcepub fn emit(
&self,
qo: &mut QirOutput,
ftype: &str,
tag: Option<&str>,
val: &QsysShotItemValue,
)
pub fn emit( &self, qo: &mut QirOutput, ftype: &str, tag: Option<&str>, val: &QsysShotItemValue, )
Emit a value with of the given type and tag.
Sourcepub fn emit_values_in_shot(&self, qo: &mut QirOutput, shot: &QsysShot)
pub fn emit_values_in_shot(&self, qo: &mut QirOutput, shot: &QsysShot)
Given a shot, check the format and emit each user value
Sourcepub fn write_shot(&self, qo: &mut QirOutput, shot: &QsysShot)
pub fn write_shot(&self, qo: &mut QirOutput, shot: &QsysShot)
Format the user defined output from shots
Sourcepub fn write_first_shot(
&self,
qo: &mut QirOutput,
shot: &QsysShot,
attributes: &QirMetadata,
)
pub fn write_first_shot( &self, qo: &mut QirOutput, shot: &QsysShot, attributes: &QirMetadata, )
Write the first shot, which includes extra metadata
Sourcepub fn write_results(
&self,
qo: &mut QirOutput,
results: &[QsysShot],
attributes: &QirMetadata,
)
pub fn write_results( &self, qo: &mut QirOutput, results: &[QsysShot], attributes: &QirMetadata, )
Write all shots, including the schema header and first-shot metadata.
Sourcepub fn qir_labeled_output(
&self,
results: &[QsysShot],
attributes: &QirMetadata,
) -> String
pub fn qir_labeled_output( &self, results: &[QsysShot], attributes: &QirMetadata, ) -> String
Given a list of results associated with an n_qubits job, return
the results in QIR “Labeled” Output Schema format.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QirLabeledFormatter
impl RefUnwindSafe for QirLabeledFormatter
impl Send for QirLabeledFormatter
impl Sync for QirLabeledFormatter
impl Unpin for QirLabeledFormatter
impl UnsafeUnpin for QirLabeledFormatter
impl UnwindSafe for QirLabeledFormatter
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