#[non_exhaustive]pub enum ArgumentValue {
Signed(i128),
Unsigned(u128),
Float32(u32),
Float64(u64),
Duration(Duration),
}Expand description
A scalar value captured for a validation constraint or error.
Floating-point values are stored as raw IEEE 754 bits, so equality and hashing preserve distinctions such as signed zero and NaN payloads. Duration values retain their exact seconds and nanoseconds. Formatting reconstructs floats and preserves unit-bearing duration diagnostics.
This enum is non-exhaustive. Downstream matches must include a wildcard arm so future scalar representations can be added without a breaking release.
ⓘ
use qubit_argument::ArgumentValue;
fn classify(value: ArgumentValue) -> &'static str {
match value {
ArgumentValue::Signed(_) => "signed",
ArgumentValue::Unsigned(_) => "unsigned",
ArgumentValue::Float32(_) => "f32",
ArgumentValue::Float64(_) => "f64",
ArgumentValue::Duration(_) => "duration",
}
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Signed(i128)
A signed integer represented without loss.
Unsigned(u128)
An unsigned integer represented without loss.
Float32(u32)
The raw bits of a 32-bit floating-point value.
Float64(u64)
The raw bits of a 64-bit floating-point value.
Duration(Duration)
An exact standard-library duration value.
Trait Implementations§
Source§impl Clone for ArgumentValue
impl Clone for ArgumentValue
Source§fn clone(&self) -> ArgumentValue
fn clone(&self) -> ArgumentValue
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ArgumentValue
Source§impl Debug for ArgumentValue
impl Debug for ArgumentValue
Source§impl Display for ArgumentValue
impl Display for ArgumentValue
impl Eq for ArgumentValue
Source§impl From<Duration> for ArgumentValue
impl From<Duration> for ArgumentValue
Source§impl From<f32> for ArgumentValue
impl From<f32> for ArgumentValue
Source§impl From<f64> for ArgumentValue
impl From<f64> for ArgumentValue
Source§impl From<i8> for ArgumentValue
impl From<i8> for ArgumentValue
Source§impl From<i16> for ArgumentValue
impl From<i16> for ArgumentValue
Source§impl From<i32> for ArgumentValue
impl From<i32> for ArgumentValue
Source§impl From<i64> for ArgumentValue
impl From<i64> for ArgumentValue
Source§impl From<i128> for ArgumentValue
impl From<i128> for ArgumentValue
Source§impl From<isize> for ArgumentValue
impl From<isize> for ArgumentValue
Source§impl From<u8> for ArgumentValue
impl From<u8> for ArgumentValue
Source§impl From<u16> for ArgumentValue
impl From<u16> for ArgumentValue
Source§impl From<u32> for ArgumentValue
impl From<u32> for ArgumentValue
Source§impl From<u64> for ArgumentValue
impl From<u64> for ArgumentValue
Source§impl From<u128> for ArgumentValue
impl From<u128> for ArgumentValue
Source§impl From<usize> for ArgumentValue
impl From<usize> for ArgumentValue
Source§impl Hash for ArgumentValue
impl Hash for ArgumentValue
Source§impl PartialEq for ArgumentValue
impl PartialEq for ArgumentValue
impl StructuralPartialEq for ArgumentValue
Auto Trait Implementations§
impl Freeze for ArgumentValue
impl RefUnwindSafe for ArgumentValue
impl Send for ArgumentValue
impl Sync for ArgumentValue
impl Unpin for ArgumentValue
impl UnsafeUnpin for ArgumentValue
impl UnwindSafe for ArgumentValue
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