pub struct ChannelAccess<'a> { /* private fields */ }Expand description
Read-only access to channel data within a memory image.
This struct borrows the raw image bytes and provides methods to read individual channels by number, iterate over populated channels, and check channel status without copying data.
Implementations§
Source§impl<'a> ChannelAccess<'a>
impl<'a> ChannelAccess<'a>
Sourcepub fn is_used(&self, number: u16) -> bool
pub fn is_used(&self, number: u16) -> bool
Check if a channel slot is in use.
Returns false for out-of-range channel numbers.
Sourcepub fn get(&self, number: u16) -> Option<ChannelEntry>
pub fn get(&self, number: u16) -> Option<ChannelEntry>
Get a specific channel by number.
Returns None if the channel number is out of range or if the
channel data cannot be read from the image.
Sourcepub fn all(&self) -> Vec<ChannelEntry>
pub fn all(&self) -> Vec<ChannelEntry>
Get all populated regular channels (0-999).
Skips empty channel slots. The returned entries are in channel number order.
Sourcepub fn all_slots(&self) -> Vec<ChannelEntry>
pub fn all_slots(&self) -> Vec<ChannelEntry>
Get all channel entries (0-999), including empty slots.
Sourcepub fn name(&self, number: u16) -> String
pub fn name(&self, number: u16) -> String
Get the display name for a channel.
Returns an empty string for channels without a user-assigned name or for out-of-range channel numbers.
Sourcepub fn flag(&self, number: u16) -> Option<ChannelFlag>
pub fn flag(&self, number: u16) -> Option<ChannelFlag>
Get the channel flag (used/band, lockout, group) for a channel.
Returns None for out-of-range channel numbers.
Sourcepub fn flash(&self, number: u16) -> Option<FlashChannel>
pub fn flash(&self, number: u16) -> Option<FlashChannel>
Get the 40-byte flash channel record for a channel.
Returns None for out-of-range channel numbers or if the data
cannot be parsed. Uses the flash memory encoding (FlashChannel)
which includes all 8 operating modes and structured D-STAR fields.
Sourcepub fn names(&self) -> Vec<String>
pub fn names(&self) -> Vec<String>
Get all channel names (0-999) as a vector of strings.
Empty names are represented as empty strings.
Sourcepub fn group_name(&self, group: u8) -> String
pub fn group_name(&self, group: u8) -> String
Get a group name by group index (0-29).
Group names are stored at name indices 1152-1181.
Sourcepub fn group_names(&self) -> Vec<String>
pub fn group_names(&self) -> Vec<String>
Get all 30 group names.