pub struct Ad<B: AsRef<[u8]>>(B);
Available on
riot_module_bluetil_ad
only.Expand description
Wrapper around bluetil_ad (BLE Advertising Data)
This is implemented as a possibly owned buffer, as that should make usage straightforward both for read-only data (not practically usable yet) and for writing; it remains to be seen whether that’s viable.
Tuple Fields§
§0: B
Implementations§
Source§impl<const L: usize> Ad<Vec<u8, L>>
impl<const L: usize> Ad<Vec<u8, L>>
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an empty AD object around owned memory; the size is given by the type parameter.
Sourcefn build(&self) -> bluetil_ad_t
fn build(&self) -> bluetil_ad_t
Construct a bluetil_ad_t that represent the current vec state
This is not unsafe in itself, but usually used with functions that are, and when they write into the buffer, it needs the unsafe heapless::Vec::set_len to propagate that write.
Auto Trait Implementations§
impl<B> Freeze for Ad<B>where
B: Freeze,
impl<B> RefUnwindSafe for Ad<B>where
B: RefUnwindSafe,
impl<B> Send for Ad<B>where
B: Send,
impl<B> Sync for Ad<B>where
B: Sync,
impl<B> Unpin for Ad<B>where
B: Unpin,
impl<B> UnwindSafe for Ad<B>where
B: UnwindSafe,
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
Source§impl<T> IntoSwitch for T
impl<T> IntoSwitch for T
Source§fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>
fn into_switch<ActiveLevel>(self) -> Switch<T, ActiveLevel>
Source§fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>where
Self: Sized,
fn into_active_high_switch(self) -> Switch<Self, ActiveHigh>where
Self: Sized,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.