core_bluetooth 0.1.0

Safe API wrapper for Core Bluetooth framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use enumflags2::{BitFlags, RawBitFlags};
use std::fmt;

pub struct BitFlagsDebug<T: RawBitFlags>(pub BitFlags<T>);

impl<T: RawBitFlags + fmt::Debug> fmt::Debug for BitFlagsDebug<T> {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        let mut it = self.0.iter().peekable();
        write!(f, "BitFlags(")?;
        while let Some(v) = it.next() {
            write!(f, "{:?}", v)?;
            if it.peek().is_some() {
                write!(f, " | ")?;
            }
        }
        write!(f, ")")
    }
}