ChannelAccess

Struct ChannelAccess 

Source
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>

Source

pub fn count(&self) -> usize

Get the number of populated (non-empty) regular channels (0-999).

Source

pub fn is_used(&self, number: u16) -> bool

Check if a channel slot is in use.

Returns false for out-of-range channel numbers.

Source

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.

Source

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.

Source

pub fn all_slots(&self) -> Vec<ChannelEntry>

Get all channel entries (0-999), including empty slots.

Source

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.

Source

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.

Source

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.

Source

pub fn names(&self) -> Vec<String>

Get all channel names (0-999) as a vector of strings.

Empty names are represented as empty strings.

Source

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.

Source

pub fn group_names(&self) -> Vec<String>

Get all 30 group names.

Trait Implementations§

Source§

impl<'a> Debug for ChannelAccess<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ChannelAccess<'a>

§

impl<'a> RefUnwindSafe for ChannelAccess<'a>

§

impl<'a> Send for ChannelAccess<'a>

§

impl<'a> Sync for ChannelAccess<'a>

§

impl<'a> Unpin for ChannelAccess<'a>

§

impl<'a> UnwindSafe for ChannelAccess<'a>

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