pub struct FeatureState {
pub value: Value,
pub access_mode: String,
pub kind: String,
pub is_implemented: bool,
pub is_available: bool,
pub numeric: Option<NumericRange>,
pub enum_available: Option<Vec<String>>,
pub unit: Option<String>,
}Expand description
Live state of a GenICam feature at a single point in time.
Replaces NodeValueUpdate as the authoritative snapshot consumed by the
UI. Every field reflects what the device reports now, not what the XML
declares statically.
§Design notes
kindis a plain string matchingviva_genapi::Node::kind_namevalues (“Integer”, “Float”, “Enumeration”, “Boolean”, “Command”, “Category”, “SwissKnife”, “Converter”, “IntConverter”, “StringReg”, “Register”). Clients should tolerate unknown kinds.access_modeuses GenICam spelling:"RO","RW","WO","NA".is_implementedandis_availabledefault totruefor deserialization from services that do not evaluate these predicates yet.numericisSomeonly for Integer/Float nodes with a resolvable range.enum_availableisSomeonly for Enumeration nodes. When the service cannot filter by IsAvailable it SHOULD still populate this with the full entry list so the UI stops falling back to static XML.
Fields§
§value: ValueCurrent feature value, typed according to kind.
access_mode: StringLive access mode.
kind: StringGenICam node kind.
is_implemented: boolWhether the node is implemented by the device.
is_available: boolWhether the node is currently accessible (selector gating etc).
numeric: Option<NumericRange>Range for Integer/Float nodes, when resolvable.
enum_available: Option<Vec<String>>Available enum entries for Enumeration nodes.
unit: Option<String>Engineering unit copied from node metadata (e.g. "us").
Implementations§
Source§impl FeatureState
impl FeatureState
Sourcepub fn to_node_value_update(&self) -> NodeValueUpdate
pub fn to_node_value_update(&self) -> NodeValueUpdate
Project this state into the legacy NodeValueUpdate shape so callers
that still speak the old contract keep working during migration.
Trait Implementations§
Source§impl Clone for FeatureState
impl Clone for FeatureState
Source§fn clone(&self) -> FeatureState
fn clone(&self) -> FeatureState
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 moreSource§impl Debug for FeatureState
impl Debug for FeatureState
Source§impl<'de> Deserialize<'de> for FeatureState
impl<'de> Deserialize<'de> for FeatureState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&FeatureState> for NodeValueUpdate
impl From<&FeatureState> for NodeValueUpdate
Source§fn from(s: &FeatureState) -> Self
fn from(s: &FeatureState) -> Self
Converts to this type from the input type.
Source§impl PartialEq for FeatureState
impl PartialEq for FeatureState
Source§fn eq(&self, other: &FeatureState) -> bool
fn eq(&self, other: &FeatureState) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FeatureState
impl Serialize for FeatureState
impl StructuralPartialEq for FeatureState
Auto Trait Implementations§
impl Freeze for FeatureState
impl RefUnwindSafe for FeatureState
impl Send for FeatureState
impl Sync for FeatureState
impl Unpin for FeatureState
impl UnsafeUnpin for FeatureState
impl UnwindSafe for FeatureState
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