Skip to main content

QirLabeledFormatter

Struct QirLabeledFormatter 

Source
pub struct QirLabeledFormatter;
Expand description

Formatter for QIR Output Spec results.

Implementations§

Source§

impl QirLabeledFormatter

Source

pub const fn new() -> Self

Construct a formatter.

Source

pub fn _val_null(&self, tag: Option<&str>, val: &QsysShotItemValue) -> bool

No null tags or null values allowed (empty strings permitted for tags)

Source

pub fn _val_tag_type(&self, tag: Option<&str>, _val: &QsysShotItemValue) -> bool

Tag must be a string

Source

pub fn validate_tag_and_value( &self, tag: Option<&str>, val: &QsysShotItemValue, ) -> bool

Ensure the tag and value are valid values

Source

pub fn results_header(&self, qo: &mut QirOutput)

Emit results header.

Source

pub fn first_shot_header(&self, qo: &mut QirOutput, attributes: &QirMetadata)

Emit opening shot boundary header.

Emit closing shot boundary footer.

Source

pub fn format_value( &self, type_str: &str, val: &QsysShotItemValue, ) -> FormattedValue

Format the value if required

Source

pub fn emit( &self, qo: &mut QirOutput, ftype: &str, tag: Option<&str>, val: &QsysShotItemValue, )

Emit a value with of the given type and tag.

Source

pub fn emit_values_in_shot(&self, qo: &mut QirOutput, shot: &QsysShot)

Given a shot, check the format and emit each user value

Source

pub fn write_shot(&self, qo: &mut QirOutput, shot: &QsysShot)

Format the user defined output from shots

Source

pub fn write_first_shot( &self, qo: &mut QirOutput, shot: &QsysShot, attributes: &QirMetadata, )

Write the first shot, which includes extra metadata

Source

pub fn write_results( &self, qo: &mut QirOutput, results: &[QsysShot], attributes: &QirMetadata, )

Write all shots, including the schema header and first-shot metadata.

Source

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§

Source§

impl Default for QirLabeledFormatter

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Ungil for T
where T: Send,