Struct blurmock::fake_device::FakeBluetoothDevice

source ·
pub struct FakeBluetoothDevice {
Show 22 fields id: Arc<Mutex<String>>, adapter: Arc<FakeBluetoothAdapter>, address: Arc<Mutex<String>>, appearance: Arc<Mutex<Option<u16>>>, class: Arc<Mutex<u32>>, gatt_services: Arc<Mutex<Vec<Arc<FakeBluetoothGATTService>>>>, is_paired: Arc<Mutex<bool>>, is_connectable: Arc<Mutex<bool>>, is_connected: Arc<Mutex<bool>>, is_trusted: Arc<Mutex<bool>>, is_blocked: Arc<Mutex<bool>>, is_legacy_pairing: Arc<Mutex<bool>>, uuids: Arc<Mutex<Vec<String>>>, name: Arc<Mutex<Option<String>>>, icon: Arc<Mutex<String>>, alias: Arc<Mutex<String>>, product_version: Arc<Mutex<u32>>, rssi: Arc<Mutex<Option<i16>>>, tx_power: Arc<Mutex<Option<i16>>>, modalias: Arc<Mutex<String>>, manufacturer_data: Arc<Mutex<Option<HashMap<u16, Vec<u8>>>>>, service_data: Arc<Mutex<Option<HashMap<String, Vec<u8>>>>>,
}

Fields§

§id: Arc<Mutex<String>>§adapter: Arc<FakeBluetoothAdapter>§address: Arc<Mutex<String>>§appearance: Arc<Mutex<Option<u16>>>§class: Arc<Mutex<u32>>§gatt_services: Arc<Mutex<Vec<Arc<FakeBluetoothGATTService>>>>§is_paired: Arc<Mutex<bool>>§is_connectable: Arc<Mutex<bool>>§is_connected: Arc<Mutex<bool>>§is_trusted: Arc<Mutex<bool>>§is_blocked: Arc<Mutex<bool>>§is_legacy_pairing: Arc<Mutex<bool>>§uuids: Arc<Mutex<Vec<String>>>§name: Arc<Mutex<Option<String>>>§icon: Arc<Mutex<String>>§alias: Arc<Mutex<String>>§product_version: Arc<Mutex<u32>>§rssi: Arc<Mutex<Option<i16>>>§tx_power: Arc<Mutex<Option<i16>>>§modalias: Arc<Mutex<String>>§manufacturer_data: Arc<Mutex<Option<HashMap<u16, Vec<u8>>>>>§service_data: Arc<Mutex<Option<HashMap<String, Vec<u8>>>>>

Implementations§

source§

impl FakeBluetoothDevice

source

pub fn new( id: String, adapter: Arc<FakeBluetoothAdapter>, address: String, appearance: Option<u16>, class: u32, gatt_services: Vec<Arc<FakeBluetoothGATTService>>, is_paired: bool, is_connectable: bool, is_connected: bool, is_trusted: bool, is_blocked: bool, is_legacy_pairing: bool, uuids: Vec<String>, name: Option<String>, icon: String, alias: String, product_version: u32, rssi: Option<i16>, tx_power: Option<i16>, modalias: String, manufacturer_data: Option<HashMap<u16, Vec<u8>>>, service_data: Option<HashMap<String, Vec<u8>>>, ) -> Arc<FakeBluetoothDevice>

source

pub fn new_empty( adapter: Arc<FakeBluetoothAdapter>, device_id: String, ) -> Arc<FakeBluetoothDevice>

source

pub fn get_id(&self) -> String

source

pub fn set_id(&self, value: String)

source

pub fn get_address(&self) -> Result<String, Box<dyn Error>>

source

pub fn set_address(&self, value: String) -> Result<(), Box<dyn Error>>

source

pub fn get_name(&self) -> Result<String, Box<dyn Error>>

source

pub fn set_name(&self, value: Option<String>) -> Result<(), Box<dyn Error>>

source

pub fn get_icon(&self) -> Result<String, Box<dyn Error>>

source

pub fn set_icon(&self, value: String) -> Result<(), Box<dyn Error>>

source

pub fn get_class(&self) -> Result<u32, Box<dyn Error>>

source

pub fn set_class(&self, value: u32) -> Result<(), Box<dyn Error>>

source

pub fn get_appearance(&self) -> Result<u16, Box<dyn Error>>

source

pub fn set_appearance(&self, value: Option<u16>) -> Result<(), Box<dyn Error>>

source

pub fn get_uuids(&self) -> Result<Vec<String>, Box<dyn Error>>

source

pub fn set_uuids(&self, value: Vec<String>) -> Result<(), Box<dyn Error>>

source

pub fn is_paired(&self) -> Result<bool, Box<dyn Error>>

source

pub fn set_paired(&self, value: bool) -> Result<(), Box<dyn Error>>

source

pub fn is_connectable(&self) -> Result<bool, Box<dyn Error>>

source

pub fn set_connectable(&self, value: bool) -> Result<(), Box<dyn Error>>

source

pub fn is_connected(&self) -> Result<bool, Box<dyn Error>>

source

pub fn set_connected(&self, value: bool) -> Result<(), Box<dyn Error>>

source

pub fn is_trusted(&self) -> Result<bool, Box<dyn Error>>

source

pub fn set_trusted(&self, value: bool) -> Result<(), Box<dyn Error>>

source

pub fn is_blocked(&self) -> Result<bool, Box<dyn Error>>

source

pub fn set_blocked(&self, value: bool) -> Result<(), Box<dyn Error>>

source

pub fn get_alias(&self) -> Result<String, Box<dyn Error>>

source

pub fn set_alias(&self, value: String) -> Result<(), Box<dyn Error>>

source

pub fn is_legacy_pairing(&self) -> Result<bool, Box<dyn Error>>

source

pub fn set_legacy_pairing(&self, value: bool) -> Result<(), Box<dyn Error>>

source

pub fn set_modalias(&self, value: String) -> Result<(), Box<dyn Error>>

source

pub fn get_rssi(&self) -> Result<i16, Box<dyn Error>>

source

pub fn set_rssi(&self, value: Option<i16>) -> Result<(), Box<dyn Error>>

source

pub fn get_tx_power(&self) -> Result<i16, Box<dyn Error>>

source

pub fn set_tx_power(&self, value: Option<i16>) -> Result<(), Box<dyn Error>>

source

pub fn get_manufacturer_data( &self, ) -> Result<HashMap<u16, Vec<u8>>, Box<dyn Error>>

source

pub fn set_manufacturer_data( &self, value: Option<HashMap<u16, Vec<u8>>>, ) -> Result<(), Box<dyn Error>>

source

pub fn get_service_data( &self, ) -> Result<HashMap<String, Vec<u8>>, Box<dyn Error>>

source

pub fn set_service_data( &self, value: Option<HashMap<String, Vec<u8>>>, ) -> Result<(), Box<dyn Error>>

source

pub fn get_adapter(&self) -> Result<Arc<FakeBluetoothAdapter>, Box<dyn Error>>

source

pub fn pair(&self) -> Result<(), Box<dyn Error>>

source

pub fn cancel_pairing(&self) -> Result<(), Box<dyn Error>>

source

pub fn get_modalias(&self) -> Result<(String, u32, u32, u32), Box<dyn Error>>

source

pub fn get_vendor_id_source(&self) -> Result<String, Box<dyn Error>>

source

pub fn get_vendor_id(&self) -> Result<u32, Box<dyn Error>>

source

pub fn get_product_id(&self) -> Result<u32, Box<dyn Error>>

source

pub fn get_device_id(&self) -> Result<u32, Box<dyn Error>>

source

pub fn get_gatt_services(&self) -> Result<Vec<String>, Box<dyn Error>>

source

pub fn get_gatt_service_structs( &self, ) -> Result<Vec<Arc<FakeBluetoothGATTService>>, Box<dyn Error>>

source

pub fn get_gatt_service( &self, id: String, ) -> Result<Arc<FakeBluetoothGATTService>, Box<dyn Error>>

source

pub fn add_service( &self, service: Arc<FakeBluetoothGATTService>, ) -> Result<(), Box<dyn Error>>

source

pub fn remove_service(&self, id: String) -> Result<(), Box<dyn Error>>

source

pub fn connect_profile(&self, _uuid: String) -> Result<(), Box<dyn Error>>

source

pub fn disconnect_profile(&self, _uuid: String) -> Result<(), Box<dyn Error>>

source

pub fn connect(&self) -> Result<(), Box<dyn Error>>

source

pub fn disconnect(&self) -> Result<(), Box<dyn Error>>

Trait Implementations§

source§

impl Clone for FakeBluetoothDevice

source§

fn clone(&self) -> FakeBluetoothDevice

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FakeBluetoothDevice

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<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.