Skip to main content

Value

Enum Value 

Source
pub enum Value {
Show 17 variants Void, Bool(ValueFormat<bool>), Octet(ValueFormat<u8>), UShort(ValueFormat<u16>), Short(ValueFormat<i16>), ULong(ValueFormat<u32>), Long(ValueFormat<i32>), ULong64(ValueFormat<u64>), Long64(ValueFormat<i64>), Float(ValueFormat<f32>), Double(ValueFormat<f64>), Enum(ValueFormat<DevEnum>), State(ValueFormat<DevState>), String(ValueFormat<str>), LongString(Spectrum<i32>, Spectrum<str>), DoubleString(Spectrum<f64>, Spectrum<str>), Encoded(DevEncoded),
}
Expand description

Any value a Tango device exchanges, whatever its element type and dimensions: what a backend encodes and decodes, and what the arguments and results of handlers are converted from and into, with From and TryFrom.

Variants§

§

Void

§

Bool(ValueFormat<bool>)

§

Octet(ValueFormat<u8>)

§

UShort(ValueFormat<u16>)

§

Short(ValueFormat<i16>)

§

ULong(ValueFormat<u32>)

§

Long(ValueFormat<i32>)

§

ULong64(ValueFormat<u64>)

§

Long64(ValueFormat<i64>)

§

Float(ValueFormat<f32>)

§

Double(ValueFormat<f64>)

§

Enum(ValueFormat<DevEnum>)

§

State(ValueFormat<DevState>)

§

String(ValueFormat<str>)

§

LongString(Spectrum<i32>, Spectrum<str>)

The DevVarLongStringArray a command may take or give.

§

DoubleString(Spectrum<f64>, Spectrum<str>)

The DevVarDoubleStringArray a command may take or give.

§

Encoded(DevEncoded)

A DevEncoded, which only exists as a scalar.

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Self

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 Value

Source§

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

Formats the value using the given formatter. Read more
Source§

impl From<&[&str]> for Value

Source§

fn from(values: &[&str]) -> Self

Converts to this type from the input type.
Source§

impl<T: TangoElement + PackedElement> From<&[T]> for Value

Source§

fn from(values: &[T]) -> Self

Converts to this type from the input type.
Source§

impl From<&str> for Value

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<()> for Value

Source§

fn from((): ()) -> Self

Converts to this type from the input type.
Source§

impl From<(Buf<f64, 1>, Buf<str, 1>)> for Value

Source§

fn from((doubles, strings): (Buf<f64, 1>, Buf<str, 1>)) -> Self

Converts to this type from the input type.
Source§

impl From<(Buf<i32, 1>, Buf<str, 1>)> for Value

Source§

fn from((longs, strings): (Buf<i32, 1>, Buf<str, 1>)) -> Self

Converts to this type from the input type.
Source§

impl<T: TangoElement + PackedElement> From<Box<[T]>> for Value

Source§

fn from(values: Box<[T]>) -> Self

Converts to this type from the input type.
Source§

impl<T: TangoElement + ?Sized> From<Buf<T, 0>> for Value

Source§

fn from(data: Scalar<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: TangoElement + ?Sized> From<Buf<T, 1>> for Value

Source§

fn from(data: Spectrum<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: TangoElement + ?Sized> From<Buf<T, 2>> for Value

Source§

fn from(data: Image<T>) -> Self

Converts to this type from the input type.
Source§

impl From<DevEncoded> for Value

Source§

fn from(encoded: DevEncoded) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Value

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl<T: TangoElement + PackedElement> From<T> for Value

Source§

fn from(value: T) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<String>> for Value

Source§

fn from(values: Vec<String>) -> Self

Converts to this type from the input type.
Source§

impl<T: TangoElement + PackedElement> From<Vec<T>> for Value

Source§

fn from(values: Vec<T>) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> From<[&str; N]> for Value

Source§

fn from(values: [&str; N]) -> Self

Converts to this type from the input type.
Source§

impl<T: TangoElement + PackedElement, const N: usize> From<[T; N]> for Value

Source§

fn from(values: [T; N]) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Value

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Value

Source§

impl<'a, T: TangoElement + ?Sized> TryFrom<&'a Value> for &'a Scalar<T>

Source§

type Error = Error

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

fn try_from(data: &'a Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl<'a, T: TangoElement + ?Sized> TryFrom<&'a Value> for &'a Spectrum<T>

Source§

type Error = Error

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

fn try_from(data: &'a Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl<'a, T: TangoElement + ?Sized> TryFrom<&'a Value> for &'a Image<T>

Source§

type Error = Error

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

fn try_from(data: &'a Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl<'a, T: TangoElement + PackedElement> TryFrom<&'a Value> for &'a [T]

Source§

type Error = Error

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

fn try_from(data: &'a Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Value> for &'a str

Source§

type Error = Error

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

fn try_from(data: &'a Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl<'a> TryFrom<&'a Value> for &'a DevEncoded

Source§

type Error = Error

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

fn try_from(data: &'a Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for bool

Source§

type Error = Error

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

fn try_from(data: &Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for u8

Source§

type Error = Error

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

fn try_from(data: &Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for u16

Source§

type Error = Error

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

fn try_from(data: &Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for i16

Source§

type Error = Error

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

fn try_from(data: &Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for u32

Source§

type Error = Error

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

fn try_from(data: &Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for i32

Source§

type Error = Error

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

fn try_from(data: &Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for u64

Source§

type Error = Error

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

fn try_from(data: &Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for i64

Source§

type Error = Error

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

fn try_from(data: &Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for f32

Source§

type Error = Error

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

fn try_from(data: &Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for f64

Source§

type Error = Error

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

fn try_from(data: &Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for DevEnum

Source§

type Error = Error

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

fn try_from(data: &Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<&Value> for DevState

Source§

type Error = Error

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

fn try_from(data: &Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl<T: TangoElement + ?Sized> TryFrom<Value> for Scalar<T>

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl<T: TangoElement + ?Sized> TryFrom<Value> for Spectrum<T>

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl<T: TangoElement + ?Sized> TryFrom<Value> for Image<T>

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for bool

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for u8

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for u16

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for i16

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for u32

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for i32

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for u64

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for i64

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for f32

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for f64

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for DevEnum

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for DevState

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl<T: TangoElement + PackedElement> TryFrom<Value> for Vec<T>

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl<T: TangoElement + PackedElement> TryFrom<Value> for Box<[T]>

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl<T: TangoElement + PackedElement, const N: usize> TryFrom<Value> for [T; N]

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for String

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for Vec<String>

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for ()

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for (Buf<i32, 1>, Buf<str, 1>)

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for (Buf<f64, 1>, Buf<str, 1>)

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.
Source§

impl TryFrom<Value> for DevEncoded

Source§

type Error = Error

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

fn try_from(data: Value) -> Result<Self, Error>

Performs the conversion.

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnsafeUnpin for Value

§

impl UnwindSafe for Value

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> FromValue for T
where T: TryFrom<Value>, <T as TryFrom<Value>>::Error: Into<Error>,

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> IntoValue for T
where T: Into<Value>,

Source§

impl<T> Model for T
where T: Send + Sync + 'static,

Source§

impl<'name, T> ReadAttrSpec<&'name str> for T
where T: FromValue,

Source§

type Output = AttrRead<T>

The final type of the output.
Source§

fn collect( reads: Vec<Named<Result<AttrRead<Value>, Error>>>, ) -> Result<<T as ReadAttrSpec<&'name str>>::Output, Error>

Build the output out of the readings, one per attribute. Read more
Source§

impl<T> ReadAttrSpec<&Buf<str, 1>> for T
where T: FromValue,

Source§

type Output = Vec<Result<AttrRead<T>, Error>>

The final type of the output.
Source§

fn collect( reads: Vec<Named<Result<AttrRead<Value>, Error>>>, ) -> Result<<T as ReadAttrSpec<&Buf<str, 1>>>::Output, Error>

Build the output out of the readings, one per attribute. Read more
Source§

impl<'name, T> ReadAttrSpec<&[&'name str]> for T
where T: FromValue,

Source§

type Output = Vec<Result<AttrRead<T>, Error>>

The final type of the output.
Source§

fn collect( reads: Vec<Named<Result<AttrRead<Value>, Error>>>, ) -> Result<<T as ReadAttrSpec<&[&'name str]>>::Output, Error>

Build the output out of the readings, one per attribute. Read more
Source§

impl<T> ReadAttrSpec<All> for T
where T: FromValue,

Source§

type Output = Vec<Named<Result<AttrRead<T>, Error>>>

The final type of the output.
Source§

fn collect( reads: Vec<Named<Result<AttrRead<Value>, Error>>>, ) -> Result<<T as ReadAttrSpec<All>>::Output, Error>

Build the output out of the readings, one per attribute. Read more
Source§

impl<T> ReadAttrSpec<Buf<str, 1>> for T
where T: FromValue,

Source§

type Output = Vec<Result<AttrRead<T>, Error>>

The final type of the output.
Source§

fn collect( reads: Vec<Named<Result<AttrRead<Value>, Error>>>, ) -> Result<<T as ReadAttrSpec<Buf<str, 1>>>::Output, Error>

Build the output out of the readings, one per attribute. Read more
Source§

impl<'name, T, const N: usize> ReadAttrSpec<[&'name str; N]> for T
where T: FromValue,

Source§

type Output = [Result<AttrRead<T>, Error>; N]

The final type of the output.
Source§

fn collect( reads: Vec<Named<Result<AttrRead<Value>, Error>>>, ) -> Result<<T as ReadAttrSpec<[&'name str; N]>>::Output, Error>

Build the output out of the readings, one per attribute. Read more
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 = !

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> 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