pub struct Event {
pub connection: ConnectionHandle,
pub status: u16,
pub kind: u8,
pub command: u8,
pub length: u8,
pub reserved: [u8; 3],
/* private fields */
}Fields§
§connection: ConnectionHandle§status: u16For a completion, the stable I/O error ID. Zero means success.
kind: u8§command: u8The command number for a completion or a discovery result.
length: u8§reserved: [u8; 3]Implementations§
Source§impl Event
impl Event
Sourcepub const COMPLETION: u8 = 1
pub const COMPLETION: u8 = 1
No payload.
Sourcepub const SCAN_RESULT: u8 = 2
pub const SCAN_RESULT: u8 = 2
ScanResult payload.
Sourcepub const CHARACTERISTIC: u8 = 4
pub const CHARACTERISTIC: u8 = 4
Characteristic payload.
Sourcepub const DESCRIPTOR: u8 = 5
pub const DESCRIPTOR: u8 = 5
Descriptor payload.
Sourcepub const VALUE: u8 = 6
pub const VALUE: u8 = 6
AttributeValue payload.
Sourcepub const NOTIFICATION: u8 = 7
pub const NOTIFICATION: u8 = 7
AttributeValue payload.
Sourcepub const DISCONNECTED: u8 = 8
pub const DISCONNECTED: u8 = 8
Disconnect reason, as an HCI error byte.
pub const fn new(kind: u8, command: u8, connection: ConnectionHandle) -> Self
pub fn with_payload<T: PlainData>(self, payload: T) -> Self
Sourcepub fn payload<T: PlainData + Default>(&self, kind: u8) -> Option<T>
pub fn payload<T: PlainData + Default>(&self, kind: u8) -> Option<T>
Decode a payload after checking the event kind and length.
pub fn as_mutable_bytes(&mut self) -> &mut [u8] ⓘ
pub fn completion(&self) -> Result<(), IoErrorKind>
Trait Implementations§
impl Copy for Event
impl Eq for Event
impl PlainData for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
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