pub struct Descriptor {
pub uuid: BluetoothUuid,
pub value: Vec<u8>,
pub is_string: bool,
}Expand description
A descriptor to publish alongside a characteristic.
Fields§
§uuid: BluetoothUuidWhich descriptor this is. The CCCD is not yours to declare.
value: Vec<u8>Its value, which a descriptor must have.
is_string: boolWhether the value is text. CoreBluetooth types a descriptor’s value by
UUID — NSString for a user description, NSData for a presentation
format — so it must be told which. Android takes bytes either way.
Implementations§
Source§impl Descriptor
impl Descriptor
Sourcepub fn user_description(text: impl Into<String>) -> Self
pub fn user_description(text: impl Into<String>) -> Self
A Characteristic User Description (0x2901) — a human-readable label.
Sourcepub fn presentation_format(bytes: impl Into<Vec<u8>>) -> Self
pub fn presentation_format(bytes: impl Into<Vec<u8>>) -> Self
A Characteristic Presentation Format descriptor (0x2904).
Seven bytes: format, exponent, unit (16-bit), namespace, description (16-bit).
Trait Implementations§
Source§impl Clone for Descriptor
impl Clone for Descriptor
Auto Trait Implementations§
impl Forget for Descriptor
impl Freeze for Descriptor
impl Move for Descriptor
impl RefUnwindSafe for Descriptor
impl Send for Descriptor
impl Sync for Descriptor
impl Unpin for Descriptor
impl UnsafeUnpin for Descriptor
impl UnwindSafe for Descriptor
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