Struct industrial_io::channel::Channel
source · pub struct Channel { /* private fields */ }
Expand description
An Industrial I/O Device Channel
Implementations
sourceimpl Channel
impl Channel
sourcepub fn is_scan_element(&self) -> bool
pub fn is_scan_element(&self) -> bool
Determines if the channel is a scan element
A scan element is a channel that can generate samples (for an input channel) or receive samples (for an output channel) after being enabled.
sourcepub fn get_attr(&self, idx: usize) -> Result<String>
pub fn get_attr(&self, idx: usize) -> Result<String>
Gets the channel-specific attribute at the index
sourcepub fn attr_read_bool(&self, attr: &str) -> Result<bool>
pub fn attr_read_bool(&self, attr: &str) -> Result<bool>
Reads a channel-specific attribute as a boolean
attr
The name of the attribute
sourcepub fn attr_read_int(&self, attr: &str) -> Result<i64>
pub fn attr_read_int(&self, attr: &str) -> Result<i64>
Reads a channel-specific attribute as an integer (i64)
attr
The name of the attribute
sourcepub fn attr_read_float(&self, attr: &str) -> Result<f64>
pub fn attr_read_float(&self, attr: &str) -> Result<f64>
Reads a channel-specific attribute as a floating-point (f64) number
attr
The name of the attribute
sourcepub fn attr_write_bool(&self, attr: &str, val: bool) -> Result<()>
pub fn attr_write_bool(&self, attr: &str, val: bool) -> Result<()>
Writes a channel-specific attribute as a boolean
attr
The name of the attribute
val
The value to write
sourcepub fn attr_write_int(&self, attr: &str, val: i64) -> Result<()>
pub fn attr_write_int(&self, attr: &str, val: i64) -> Result<()>
Writes a channel-specific attribute as an integer (i64)
attr
The name of the attribute
val
The value to write
sourcepub fn attr_write_float(&self, attr: &str, val: f64) -> Result<()>
pub fn attr_write_float(&self, attr: &str, val: f64) -> Result<()>
Writes a channel-specific attribute as a floating-point (f64) number
attr
The name of the attribute
val
The value to write
sourcepub fn attrs(&self) -> AttrIterator<'_> ⓘ
pub fn attrs(&self) -> AttrIterator<'_> ⓘ
Gets an iterator for the attributes of the channel
sourcepub fn enable(&mut self)
pub fn enable(&mut self)
Enable the channel
Before creating a buffer, at least one channel of the device must be enabled.
sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Determines if the channel is enabled