[][src]Enum q1tsim::gates::Parameter

pub enum Parameter {
    Direct(f64),
    Reference(Rc<RefCell<f64>>, String),
    FFIRef(*const f64),
}

Enumeration for parameters (usually angles) to a gate. This can either be a direct floating points value, or a reference to one. In the latter case, the value of the parameter can be changed outside the circuit, which can be useful to e.g. to reexecute a circuit with the end state of the last excution, but with a different value for a parameter. For reference parameters, a name is associated with the parameter for the description, since its value can change.

Variants

Direct(f64)

Direct value

Reference(Rc<RefCell<f64>>, String)

Reference value, mutable outside the circuit, with its name

FFIRef(*const f64)

Reference parameter from external code

Methods

impl Parameter[src]

pub fn from_refcell(cell: &Rc<RefCell<f64>>, name: &str) -> Self[src]

Create a new reference parameter from cell with name name.

pub fn value(&self) -> f64[src]

Return the current value of the parameter

Trait Implementations

impl From<f64> for Parameter[src]

impl From<CParameter> for Parameter[src]

impl Display for Parameter[src]

Auto Trait Implementations

impl !Sync for Parameter

impl !Send for Parameter

impl Unpin for Parameter

impl !UnwindSafe for Parameter

impl !RefUnwindSafe for Parameter

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,