pub struct CommandCompleteWithStatus<'d> {
pub num_hci_cmd_pkts: u8,
pub cmd_opcode: Opcode,
pub status: Status,
pub return_param_bytes: RemainingBytes<'d>,
}Expand description
Struct representing a command complete event with status
Fields§
§num_hci_cmd_pkts: u8Number of packets complete.
cmd_opcode: OpcodeCommand opcode.
status: StatusCommand status.
return_param_bytes: RemainingBytes<'d>Return parameters
Implementations§
Source§impl CommandCompleteWithStatus<'_>
impl CommandCompleteWithStatus<'_>
Sourcepub fn handle<C: SyncCmd>(&self) -> Result<C::Handle, FromHciBytesError>
pub fn handle<C: SyncCmd>(&self) -> Result<C::Handle, FromHciBytesError>
Gets the connection handle associated with the command that has completed.
For commands that return the connection handle provided as a parameter as
their first return parameter, this will be valid even if status is an error.
Sourcepub fn to_result<C: SyncCmd>(&self) -> Result<C::Return, Error>
pub fn to_result<C: SyncCmd>(&self) -> Result<C::Return, Error>
Gets a result with the return parameters for C or an Error if status is
an error.
§Panics
May panic if C::OPCODE is not equal to self.cmd_opcode.
Sourcepub fn return_params<C: SyncCmd>(&self) -> Result<C::Return, FromHciBytesError>
pub fn return_params<C: SyncCmd>(&self) -> Result<C::Return, FromHciBytesError>
Parses the return parameters for C from this event. This may fail if status
is an error.
§Panics
May panic if C::OPCODE is not equal to self.cmd_opcode.
Trait Implementations§
Source§impl<'d> Clone for CommandCompleteWithStatus<'d>
impl<'d> Clone for CommandCompleteWithStatus<'d>
Source§fn clone(&self) -> CommandCompleteWithStatus<'d>
fn clone(&self) -> CommandCompleteWithStatus<'d>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'d> Debug for CommandCompleteWithStatus<'d>
impl<'d> Debug for CommandCompleteWithStatus<'d>
Source§impl<'d> PartialEq for CommandCompleteWithStatus<'d>
impl<'d> PartialEq for CommandCompleteWithStatus<'d>
Source§fn eq(&self, other: &CommandCompleteWithStatus<'d>) -> bool
fn eq(&self, other: &CommandCompleteWithStatus<'d>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<'d> TryFrom<CommandComplete<'d>> for CommandCompleteWithStatus<'d>
impl<'d> TryFrom<CommandComplete<'d>> for CommandCompleteWithStatus<'d>
Source§type Error = FromHciBytesError
type Error = FromHciBytesError
The type returned in the event of a conversion error.
Source§fn try_from(
e: CommandComplete<'d>,
) -> Result<CommandCompleteWithStatus<'d>, Self::Error>
fn try_from( e: CommandComplete<'d>, ) -> Result<CommandCompleteWithStatus<'d>, Self::Error>
Performs the conversion.
impl<'d> Eq for CommandCompleteWithStatus<'d>
impl<'d> StructuralPartialEq for CommandCompleteWithStatus<'d>
Auto Trait Implementations§
impl<'d> Freeze for CommandCompleteWithStatus<'d>
impl<'d> RefUnwindSafe for CommandCompleteWithStatus<'d>
impl<'d> Send for CommandCompleteWithStatus<'d>
impl<'d> Sync for CommandCompleteWithStatus<'d>
impl<'d> Unpin for CommandCompleteWithStatus<'d>
impl<'d> UnsafeUnpin for CommandCompleteWithStatus<'d>
impl<'d> UnwindSafe for CommandCompleteWithStatus<'d>
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