Skip to main content

AttrConfig

Struct AttrConfig 

Source
pub struct AttrConfig {
Show 15 fields pub doc: Option<Cow<'static, str>>, pub label: Option<Cow<'static, str>>, pub unit: Option<Cow<'static, str>>, pub standard_unit: Option<f64>, pub display_unit: Option<Cow<'static, str>>, pub display_format: Option<Cow<'static, str>>, pub range: AttrRangeConfig, pub alarm: AttrRangeConfig, pub warning: AttrRangeConfig, pub delta: Option<AttrDeltaConfig>, pub change_event: AttrChangeEventConfig, pub periodic_event: AttrPeriodicEventConfig, pub archive_event: AttrArchiveEventConfig, pub enum_labels: Vec<Cow<'static, str>>, pub extensions: Vec<Cow<'static, str>>,
}
Expand description

Represent the current configuration of an attribute

The default configuration is the one of an attribute that declares nothing: no description, no unit, no bound of any kind, no event configured, at the operator display level, which is what a definition starts from and then fills in.

This is exactly what Tango keeps as the attribute properties of a device in the database, and therefore exactly what a client is allowed to change, which is what crate::backend::BackendDev::set_attr_config carries. Everything else a client reads about an attribute is what the attribute is rather than how it is configured, and is declared by the device, see AttrInfo.

Fields§

§doc: Option<Cow<'static, str>>

The optional description of the attribute, which a client may change like any other property, description being one of the attribute properties Tango keeps.

§label: Option<Cow<'static, str>>

The optional label of the attribute.

§unit: Option<Cow<'static, str>>

The optional real unit of the attribute: how the raw attribute value is represented.

§standard_unit: Option<f64>

The conversion factor for going from the raw attribute value to the international unit system.

§display_unit: Option<Cow<'static, str>>

The optional unit for displaying to the user.

§display_format: Option<Cow<'static, str>>

The display format of this value. That format is specified using printf formatting symbols using %.

§range: AttrRangeConfig

The allowed range for this attribute’s value.

§alarm: AttrRangeConfig

The alarm range for this attribute’s value.

§warning: AttrRangeConfig

The warning range for this attribute’s value.

§delta: Option<AttrDeltaConfig>

The optional delta alarm.

§change_event: AttrChangeEventConfig

Configuration of the change event.

§periodic_event: AttrPeriodicEventConfig

Configuration of the periodic event.

§archive_event: AttrArchiveEventConfig

Configuration of the periodic event.

§enum_labels: Vec<Cow<'static, str>>

What the values of the attribute mean, which only a DevEnum has any of: they name its values, an enumerated value being the index of its own label in this list.

This is a property like any other and a client may change it, which is why it is here and not beside AttrInfo::data_kind: what a value of the attribute is stays a DevEnum whatever the labels are renamed to.

§extensions: Vec<Cow<'static, str>>

Possible extensions.

Trait Implementations§

Source§

impl Clone for AttrConfig

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 AttrConfig

Source§

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

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

impl Default for AttrConfig

Source§

fn default() -> Self

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

impl PartialEq for AttrConfig

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 AttrConfig

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> Model for T
where T: Send + Sync + 'static,

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