NodeMap

Struct NodeMap 

Source
pub struct NodeMap { /* private fields */ }
Expand description

Runtime nodemap built from an [XmlModel] capable of reading and writing feature values via a RegisterIo transport.

Implementations§

Source§

impl NodeMap

Source

pub fn version(&self) -> &str

Return the schema version string associated with the XML description.

Source

pub fn node(&self, name: &str) -> Option<&Node>

Fetch a node by name for inspection.

Source

pub fn try_from_xml(model: XmlModel) -> Result<Self, GenApiError>

Construct a NodeMap from an [XmlModel], validating SwissKnife expressions.

Source

pub fn get_integer( &self, name: &str, io: &dyn RegisterIo, ) -> Result<i64, GenApiError>

Read an integer feature value using the provided transport.

Source

pub fn set_integer( &mut self, name: &str, value: i64, io: &dyn RegisterIo, ) -> Result<(), GenApiError>

Write an integer feature and update dependent caches.

Source

pub fn get_float( &self, name: &str, io: &dyn RegisterIo, ) -> Result<f64, GenApiError>

Read a floating point feature.

Source

pub fn set_float( &mut self, name: &str, value: f64, io: &dyn RegisterIo, ) -> Result<(), GenApiError>

Write a floating point feature using the scale/offset conversion.

Source

pub fn get_enum( &self, name: &str, io: &dyn RegisterIo, ) -> Result<String, GenApiError>

Read an enumeration feature returning the symbolic entry name.

Source

pub fn set_enum( &mut self, name: &str, entry: &str, io: &dyn RegisterIo, ) -> Result<(), GenApiError>

Write an enumeration entry.

Source

pub fn enum_entries(&self, name: &str) -> Result<Vec<String>, GenApiError>

List the available entry names for an enumeration feature.

Source

pub fn get_bool( &self, name: &str, io: &dyn RegisterIo, ) -> Result<bool, GenApiError>

Read a boolean feature.

Source

pub fn set_bool( &mut self, name: &str, value: bool, io: &dyn RegisterIo, ) -> Result<(), GenApiError>

Write a boolean feature.

Source

pub fn exec_command( &mut self, name: &str, io: &dyn RegisterIo, ) -> Result<(), GenApiError>

Execute a command feature by writing a one-valued payload.

Trait Implementations§

Source§

impl Debug for NodeMap

Source§

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

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

impl From<XmlModel> for NodeMap

Source§

fn from(model: XmlModel) -> Self

Converts to this type from the input type.

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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, 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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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