pub struct Channel<'a> { /* private fields */ }Expand description
High level handle for a single channel within a group.
It holds references to the raw blocks and allows convenient access to metadata and decoded values.
Implementations§
Source§impl<'a> Channel<'a>
impl<'a> Channel<'a>
Sourcepub fn new(
block: &'a ChannelBlock,
raw_data_group: &'a RawDataGroup,
raw_channel_group: &'a RawChannelGroup,
raw_channel: &'a RawChannel,
mmap: &'a [u8],
) -> Self
pub fn new( block: &'a ChannelBlock, raw_data_group: &'a RawDataGroup, raw_channel_group: &'a RawChannelGroup, raw_channel: &'a RawChannel, mmap: &'a [u8], ) -> Self
Construct a new Channel from raw block references.
§Arguments
block- Channel block containing metadataraw_data_group- Parent data groupraw_channel_group- Parent channel groupraw_channel- Raw channel helper used to iterate samplesmmap- Memory mapped file backing all data
§Returns
A Channel handle with no samples decoded yet.
Sourcepub fn source(&self) -> Result<Option<SourceInfo>>
pub fn source(&self) -> Result<Option<SourceInfo>>
Get the acquisition source for this channel if available.
Sourcepub fn values(&self) -> Result<Vec<Option<DecodedValue>>>
pub fn values(&self) -> Result<Vec<Option<DecodedValue>>>
Decode and convert all samples of this channel.
This method decodes all channel values and applies conversions.
Invalid samples (as indicated by invalidation bits) are returned as None.
§Returns
A vector with one Option<DecodedValue> per record:
Some(value)for valid samplesNonefor invalid samples (invalidation bit set or decoding failed)
Sourcepub fn block(&self) -> &ChannelBlock
pub fn block(&self) -> &ChannelBlock
Get the channel block (for internal use)
Auto Trait Implementations§
impl<'a> Freeze for Channel<'a>
impl<'a> RefUnwindSafe for Channel<'a>
impl<'a> Send for Channel<'a>
impl<'a> Sync for Channel<'a>
impl<'a> Unpin for Channel<'a>
impl<'a> UnwindSafe for Channel<'a>
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