Struct Event
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§
§impl Event
impl Event
pub const COMPLETION: u8 = 1
pub const COMPLETION: u8 = 1
No payload.
pub const SCAN_RESULT: u8 = 2
pub const SCAN_RESULT: u8 = 2
ScanResult payload.
pub const CHARACTERISTIC: u8 = 4
pub const CHARACTERISTIC: u8 = 4
Characteristic payload.
pub const DESCRIPTOR: u8 = 5
pub const DESCRIPTOR: u8 = 5
Descriptor payload.
pub const VALUE: u8 = 6
pub const VALUE: u8 = 6
AttributeValue payload.
pub const NOTIFICATION: u8 = 7
pub const NOTIFICATION: u8 = 7
AttributeValue payload.
pub 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) -> Event
pub fn with_payload<T>(self, payload: T) -> Eventwhere
T: PlainData,
pub fn payload<T>(&self, kind: u8) -> Option<T>where
T: PlainData + Default,
pub fn payload<T>(&self, kind: u8) -> Option<T>where
T: PlainData + Default,
Decode a payload after checking the event kind and length.
pub fn as_mutable_bytes(&mut self) -> &mut [u8] ⓘ
pub fn completion(&self) -> Result<(), Kind>
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