LedDevice

Struct LedDevice 

Source
pub struct LedDevice {
    pub name: String,
    pub alias: String,
    /* private fields */
}

Fields§

§name: String§alias: String

Trait Implementations§

Source§

impl Debug for LedDevice

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Device for LedDevice

Source§

fn alias(&self) -> &str

Provides access to user-settable device alias

Source§

fn name(&self) -> &str

Provides access to the device local_name

Source§

fn address(&self) -> Option<String>

Provides access to BLE-specific MAC device address

Source§

fn set_alias(&mut self, alias: &str)

Allows to set user-settable device alias

Source§

fn new( name: &str, alias: &str, peripheral: Option<Peripheral>, write_char: Option<Characteristic>, read_char: Option<Characteristic>, ) -> Self

Source§

fn peripheral(&self) -> Option<&Peripheral>

Source§

fn write_char(&self) -> Option<&Characteristic>

Source§

fn read_char(&self) -> Option<&Characteristic>

Source§

fn default_write_characteristic_uuid(&self) -> Uuid

Source§

fn set_name(&mut self, name: &str)

Source§

fn set_peripheral(&mut self, peripheral: Peripheral)

Source§

fn set_write_char(&mut self, characteristic: &Characteristic)

Allows to set the default characteristic (Write or Read), per-device by providing the Characteristic. Read more
Source§

fn characteristics(&self) -> Option<Vec<Characteristic>>

Return all the discovered device characteristic. Read more
Source§

fn characteristics_by_type( &self, kinds: BitFlags<OpKind>, ) -> Option<Vec<Characteristic>>

Return all the discovered device characteristic and allows to filter them by type Read more
Source§

fn set_char( &mut self, char_kind: &CharKind, uuid_kind: &UuidKind, ) -> Result<(), BluetoothError>

Allows to set the default characteristic (Write or Read), per-device by providing the UuidKind of the characteristic. Read more
Source§

fn set_char_with_uuid( &mut self, char_kind: &CharKind, uuid: &Uuid, ) -> Result<(), BluetoothError>

Source§

fn set_char_with_u16( &mut self, char_kind: &CharKind, u16: u16, ) -> Result<(), BluetoothError>

Source§

fn set_char_with_u32( &mut self, char_kind: &CharKind, u32: u32, ) -> Result<(), BluetoothError>

Source§

impl Display for LedDevice

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<D> Brightness for D
where D: Device + Sync,

Source§

fn set<'e, 'life0, 'async_trait, P>( device: &'life0 D, protocol: &'e P, option: &'e BrightnessOption<'_>, ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'e: 'async_trait, 'life0: 'async_trait, P: 'async_trait + Protocol + Send + Sync, D: 'async_trait,

Source§

fn brightness<'e, 'life0, 'async_trait, P>( &'life0 self, protocol: &'e P, r: u8, g: u8, b: u8, level: f32, ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'e: 'async_trait, 'life0: 'async_trait, P: 'async_trait + Protocol + Send + Sync, D: 'async_trait,

Source§

impl<D> Color for D
where D: Device + Sync,

Source§

fn set<'e, 'life0, 'async_trait, P>( device: &'life0 D, protocol: &'e P, option: &'e ColorOption, ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'e: 'async_trait, 'life0: 'async_trait, P: 'async_trait + Protocol + Send + Sync, D: 'async_trait,

Source§

fn color<'e, 'life0, 'async_trait, P>( &'life0 self, protocol: &'e P, r: u8, g: u8, b: u8, ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'e: 'async_trait, 'life0: 'async_trait, P: 'async_trait + Protocol + Send + Sync, D: 'async_trait,

Source§

impl<D> Disconnect for D
where D: Device + Sync,

Source§

fn leave<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'life0: 'async_trait, D: 'async_trait,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<D> HWAnimate for D
where D: Device + Sync,

Source§

fn set<'e, 'life0, 'async_trait, P>( device: &'life0 D, protocol: &'e P, option: &'e HWAnimateOption<'_>, ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'e: 'async_trait, 'life0: 'async_trait, P: 'async_trait + Protocol + Send + Sync, D: 'async_trait,

Source§

fn hw_anim_pulsating<'e, 'life0, 'async_trait, P>( &'life0 self, protocol: &'e P, color: &'e HWStaticColorOption, speed: &'e HWAnimationSpeedSetting, ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'e: 'async_trait, 'life0: 'async_trait, P: 'async_trait + Protocol + Send + Sync, D: 'async_trait,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<D> Light for D
where D: Device + Sync,

Source§

fn set<'e, 'life0, 'async_trait, P>( device: &'life0 D, protocol: &'e P, option: &'e LightOption, ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'e: 'async_trait, 'life0: 'async_trait, P: 'async_trait + Protocol + Send + Sync, D: 'async_trait,

Source§

fn turn_on<'e, 'life0, 'async_trait, P>( &'life0 self, protocol: &'e P, ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'e: 'async_trait, 'life0: 'async_trait, P: 'async_trait + Protocol + Send + Sync, D: 'async_trait,

Source§

fn turn_off<'e, 'life0, 'async_trait, P>( &'life0 self, protocol: &'e P, ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'e: 'async_trait, 'life0: 'async_trait, P: 'async_trait + Protocol + Send + Sync, D: 'async_trait,

Source§

impl<D> SWAnimate for D
where D: Device + Sync,

Source§

fn set<'e, 'life0, 'async_trait, P>( &'life0 self, protocol: &'e P, option: &'e SWAnimateOption<'_>, ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'e: 'async_trait, 'life0: 'async_trait, P: 'async_trait + Protocol + Send + Sync, D: 'async_trait,

Source§

fn _breathing<'e, 'life0, 'async_trait, P>( &'life0 self, protocol: &'e P, color: &'e ColorOption, interval: u64, ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'e: 'async_trait, 'life0: 'async_trait, P: 'async_trait + Protocol + Send + Sync, D: 'async_trait,

Source§

fn breathing<'e, 'life0, 'async_trait, P>( &'life0 self, protocol: &'e P, color: &'e ColorOption, repeat: &'e SWAnimationRepeat, speed: &'e SWAnimationSpeed, ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'e: 'async_trait, 'life0: 'async_trait, P: 'async_trait + Protocol + Send + Sync, D: 'async_trait,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<D> Write for D
where D: Device + Sync,

Source§

fn push<'life0, 'life1, 'async_trait>( &'life0 self, raw_bytes: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), BluetoothError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, D: 'async_trait,