Skip to main content

ParamValue

Enum ParamValue 

Source
pub enum ParamValue {
Show 16 variants Int32(i32), Int64(i64), UInt64(u64), Float64(f64), Octet(String), UInt32Digital(u32), Int8Array(Arc<[i8]>), Int16Array(Arc<[i16]>), Int32Array(Arc<[i32]>), Int64Array(Arc<[i64]>), UInt64Array(Arc<[u64]>), Float32Array(Arc<[f32]>), Float64Array(Arc<[f64]>), Enum { index: usize, choices: Arc<[EnumEntry]>, }, GenericPointer(Arc<dyn Any + Send + Sync>), Undefined,
}
Expand description

Parameter value. Arrays use Arc<[T]> for cheap cloning during interrupt broadcast. Octet uses String (typically short; not intended for large binary data).

Variants§

§

Int32(i32)

§

Int64(i64)

§

UInt64(u64)

Unsigned 64-bit integer (asyn upstream issue #231).

§

Float64(f64)

§

Octet(String)

§

UInt32Digital(u32)

§

Int8Array(Arc<[i8]>)

§

Int16Array(Arc<[i16]>)

§

Int32Array(Arc<[i32]>)

§

Int64Array(Arc<[i64]>)

§

UInt64Array(Arc<[u64]>)

Unsigned 64-bit integer array (asyn upstream issue #231).

§

Float32Array(Arc<[f32]>)

§

Float64Array(Arc<[f64]>)

§

Enum

Fields

§index: usize
§choices: Arc<[EnumEntry]>
§

GenericPointer(Arc<dyn Any + Send + Sync>)

§

Undefined

Implementations§

Source§

impl ParamValue

Source

pub fn type_name(&self) -> &'static str

Source

pub fn as_int32(&self) -> AsynResult<i32>

Read this value through the asynInt32 interface — the single owner of that interface’s read rule, shared by the parameter-store getters (ParamList::get_int32) and the device-support I/O-Intr path, so a value delivered to a record cannot be typed differently from the same value read by a poll.

A parameter whose type the interface cannot read is an AsynError::TypeMismatch, never a coercion: C keeps one interrupt list per interface, so a record on asynInt32 is only ever handed an int32 (an enum’s index included — asynInt32 reads an enum’s index transparently).

Source

pub fn as_int64(&self) -> AsynResult<i64>

Read this value through the asynInt64 interface. See Self::as_int32.

Source

pub fn as_float64(&self) -> AsynResult<f64>

Read this value through the asynFloat64 interface. See Self::as_int32.

Source

pub fn as_octet(&self) -> AsynResult<&str>

Read this value through the asynOctet interface. See Self::as_int32.

Source

pub fn as_uint32(&self) -> AsynResult<u32>

Read this value through the asynUInt32Digital interface. See Self::as_int32.

Source

pub fn as_enum(&self) -> AsynResult<(usize, Arc<[EnumEntry]>)>

Read this value through the asynEnum interface. See Self::as_int32.

Source

pub fn is_array(&self) -> bool

Whether this is an array or generic-pointer value. C asynPortDriver fires interrupts for these through the per-type doCallbacks*Array / doCallbacksGenericPointer paths, NOT paramList::callCallbacks (whose switch at asynPortDriver.cpp:846-865 handles only scalars). The callCallbacks isDefined gate (:845) therefore does not govern them, so the Rust flush must keep firing array triggers regardless of the defined flag.

Trait Implementations§

Source§

impl Clone for ParamValue

Source§

fn clone(&self) -> ParamValue

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParamValue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more