pub struct Index(/* private fields */);
Implementations§
Source§impl Index
impl Index
pub const INDEX_MAX: u8 = 39u8
pub const ZERO: Index
pub const MAX: Index
pub const ADVERTISING: [Index; 3]
pub fn new(index: u8) -> Index
pub fn new_checked(index: u8) -> Option<Index>
pub fn new_clamped(index: u8) -> Index
Sourcepub fn frequency(self) -> usize
pub fn frequency(self) -> usize
Returns channel frequency in MHz.
§Example
use btle::channel::Index;
assert_eq!(Index::new(37).frequency(), 2402);
assert_eq!(Index::new(0).frequency(), 2404);
assert_eq!(Index::new(10).frequency(), 2424);
assert_eq!(Index::new(38).frequency(), 2426);
assert_eq!(Index::new(11).frequency(), 2428);
assert_eq!(Index::new(36).frequency(), 2478);
pub fn is_advertising(self) -> bool
pub const fn as_u8(self) -> u8
Trait Implementations§
Source§impl Ord for Index
impl Ord for Index
Source§impl PartialOrd for Index
impl PartialOrd for Index
impl Copy for Index
impl Eq for Index
impl StructuralPartialEq for Index
Auto Trait Implementations§
impl Freeze for Index
impl RefUnwindSafe for Index
impl Send for Index
impl Sync for Index
impl Unpin for Index
impl UnwindSafe for Index
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