Skip to main content

ChannelBlock

Struct ChannelBlock 

Source
pub struct ChannelBlock {
    pub start_hz: u32,
    pub step_hz: u32,
    pub count: u16,
    pub min_data_rate: u8,
    pub max_data_rate: u8,
}
Expand description

A run of evenly spaced channels, which is how the plans define them.

Every region lays its channels out as a start frequency and a fixed step, so a plan carries the arithmetic rather than 72 literal frequencies.

Fields§

§start_hz: u32

The frequency of the first channel in the block, in hertz.

§step_hz: u32

The spacing between channels, in hertz.

§count: u16

How many channels the block holds.

§min_data_rate: u8

The lowest data rate usable on these channels.

§max_data_rate: u8

The highest data rate usable on these channels.

Implementations§

Source§

impl ChannelBlock

Source

pub const fn new( start_hz: u32, step_hz: u32, count: u16, min_data_rate: u8, max_data_rate: u8, ) -> Self

Builds a block of evenly spaced channels.

§Arguments
  • start_hz - the first channel frequency in hertz.
  • step_hz - the spacing between channels in hertz.
  • count - how many channels the block holds.
  • min_data_rate - the lowest data rate usable on them.
  • max_data_rate - the highest data rate usable on them.
§Returns

The block.

Source

pub const fn frequency_hz(&self, index: u16) -> Option<u32>

Returns the frequency of one channel in the block.

§Arguments
  • index - the channel’s position within this block.
§Returns

Some(hz), or None if index is past the end of the block.

Trait Implementations§

Source§

impl Clone for ChannelBlock

Source§

fn clone(&self) -> ChannelBlock

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ChannelBlock

Source§

impl Debug for ChannelBlock

Source§

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

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

impl Eq for ChannelBlock

Source§

impl PartialEq for ChannelBlock

Source§

fn eq(&self, other: &ChannelBlock) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ChannelBlock

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.