[][src]Struct btle::hci::Opcode

pub struct Opcode(pub OGF, pub OCF);

16-bit HCI Opcode. Contains a OGF (OpCode Ground Field) and OCF (OpCode Command Field).

Methods

impl Opcode[src]

pub const fn byte_len() -> usize[src]

pub fn pack(self, buf: &mut [u8]) -> Result<(), HCIPackError>[src]

Errors

returns HCIPackError::BadLength if buf.len() != OPCODE_LEN.

pub fn unpack(buf: &[u8]) -> Result<Opcode, HCIPackError>[src]

Errors

returns HCIPackError::BadLength if buf.len() != OPCODE_LEN. returns HCIPackError::BadBytes if buf doesn't contain a value opcode.

pub const fn nop() -> Opcode[src]

pub fn is_nop(self) -> bool[src]

Trait Implementations

impl Clone for Opcode[src]

impl Copy for Opcode[src]

impl Debug for Opcode[src]

impl Default for Opcode[src]

impl Eq for Opcode[src]

impl From<LEControllerOpcode> for Opcode[src]

impl From<LinkControlOpcode> for Opcode[src]

impl From<Opcode> for u16[src]

impl Hash for Opcode[src]

impl Ord for Opcode[src]

impl PartialEq<Opcode> for Opcode[src]

impl PartialOrd<Opcode> for Opcode[src]

impl StructuralEq for Opcode[src]

impl StructuralPartialEq for Opcode[src]

impl TryFrom<u16> for Opcode[src]

type Error = HCIConversionError

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Opcode

impl Send for Opcode

impl Sync for Opcode

impl Unpin for Opcode

impl UnwindSafe for Opcode

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.