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
impl FakeBluetoothDevice
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>
pub fn new_empty( adapter: Arc<FakeBluetoothAdapter>, device_id: String, ) -> Arc<FakeBluetoothDevice>
pub fn get_id(&self) -> String
pub fn set_id(&self, value: String)
pub fn get_address(&self) -> Result<String, Box<dyn Error>>
pub fn set_address(&self, value: String) -> Result<(), Box<dyn Error>>
pub fn get_name(&self) -> Result<String, Box<dyn Error>>
pub fn set_name(&self, value: Option<String>) -> Result<(), Box<dyn Error>>
pub fn get_icon(&self) -> Result<String, Box<dyn Error>>
pub fn set_icon(&self, value: String) -> Result<(), Box<dyn Error>>
pub fn get_class(&self) -> Result<u32, Box<dyn Error>>
pub fn set_class(&self, value: u32) -> Result<(), Box<dyn Error>>
pub fn get_appearance(&self) -> Result<u16, Box<dyn Error>>
pub fn set_appearance(&self, value: Option<u16>) -> Result<(), Box<dyn Error>>
pub fn get_uuids(&self) -> Result<Vec<String>, Box<dyn Error>>
pub fn set_uuids(&self, value: Vec<String>) -> Result<(), Box<dyn Error>>
pub fn is_paired(&self) -> Result<bool, Box<dyn Error>>
pub fn set_paired(&self, value: bool) -> Result<(), Box<dyn Error>>
pub fn is_connectable(&self) -> Result<bool, Box<dyn Error>>
pub fn set_connectable(&self, value: bool) -> Result<(), Box<dyn Error>>
pub fn is_connected(&self) -> Result<bool, Box<dyn Error>>
pub fn set_connected(&self, value: bool) -> Result<(), Box<dyn Error>>
pub fn is_trusted(&self) -> Result<bool, Box<dyn Error>>
pub fn set_trusted(&self, value: bool) -> Result<(), Box<dyn Error>>
pub fn is_blocked(&self) -> Result<bool, Box<dyn Error>>
pub fn set_blocked(&self, value: bool) -> Result<(), Box<dyn Error>>
pub fn get_alias(&self) -> Result<String, Box<dyn Error>>
pub fn set_alias(&self, value: String) -> Result<(), Box<dyn Error>>
pub fn is_legacy_pairing(&self) -> Result<bool, Box<dyn Error>>
pub fn set_legacy_pairing(&self, value: bool) -> Result<(), Box<dyn Error>>
pub fn set_modalias(&self, value: String) -> Result<(), Box<dyn Error>>
pub fn get_rssi(&self) -> Result<i16, Box<dyn Error>>
pub fn set_rssi(&self, value: Option<i16>) -> Result<(), Box<dyn Error>>
pub fn get_tx_power(&self) -> Result<i16, Box<dyn Error>>
pub fn set_tx_power(&self, value: Option<i16>) -> Result<(), Box<dyn Error>>
pub fn get_manufacturer_data( &self, ) -> Result<HashMap<u16, Vec<u8>>, Box<dyn Error>>
pub fn set_manufacturer_data( &self, value: Option<HashMap<u16, Vec<u8>>>, ) -> Result<(), Box<dyn Error>>
pub fn get_service_data( &self, ) -> Result<HashMap<String, Vec<u8>>, Box<dyn Error>>
pub fn set_service_data( &self, value: Option<HashMap<String, Vec<u8>>>, ) -> Result<(), Box<dyn Error>>
pub fn get_adapter(&self) -> Result<Arc<FakeBluetoothAdapter>, Box<dyn Error>>
pub fn pair(&self) -> Result<(), Box<dyn Error>>
pub fn cancel_pairing(&self) -> Result<(), Box<dyn Error>>
pub fn get_modalias(&self) -> Result<(String, u32, u32, u32), Box<dyn Error>>
pub fn get_vendor_id_source(&self) -> Result<String, Box<dyn Error>>
pub fn get_vendor_id(&self) -> Result<u32, Box<dyn Error>>
pub fn get_product_id(&self) -> Result<u32, Box<dyn Error>>
pub fn get_device_id(&self) -> Result<u32, Box<dyn Error>>
pub fn get_gatt_services(&self) -> Result<Vec<String>, Box<dyn Error>>
pub fn get_gatt_service_structs( &self, ) -> Result<Vec<Arc<FakeBluetoothGATTService>>, Box<dyn Error>>
pub fn get_gatt_service( &self, id: String, ) -> Result<Arc<FakeBluetoothGATTService>, Box<dyn Error>>
pub fn add_service( &self, service: Arc<FakeBluetoothGATTService>, ) -> Result<(), Box<dyn Error>>
pub fn remove_service(&self, id: String) -> Result<(), Box<dyn Error>>
pub fn connect_profile(&self, _uuid: String) -> Result<(), Box<dyn Error>>
pub fn disconnect_profile(&self, _uuid: String) -> Result<(), Box<dyn Error>>
pub fn connect(&self) -> Result<(), Box<dyn Error>>
pub fn disconnect(&self) -> Result<(), Box<dyn Error>>
Trait Implementations§
source§impl Clone for FakeBluetoothDevice
impl Clone for FakeBluetoothDevice
source§fn clone(&self) -> FakeBluetoothDevice
fn clone(&self) -> FakeBluetoothDevice
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for FakeBluetoothDevice
impl RefUnwindSafe for FakeBluetoothDevice
impl Send for FakeBluetoothDevice
impl Sync for FakeBluetoothDevice
impl Unpin for FakeBluetoothDevice
impl UnwindSafe for FakeBluetoothDevice
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