Struct blurmock::fake_adapter::FakeBluetoothAdapter
source · pub struct FakeBluetoothAdapter {Show 18 fields
id: Arc<Mutex<String>>,
is_present: Arc<Mutex<bool>>,
is_powered: Arc<Mutex<bool>>,
can_start_discovery: Arc<Mutex<bool>>,
can_stop_discovery: Arc<Mutex<bool>>,
devices: Arc<Mutex<Vec<Arc<FakeBluetoothDevice>>>>,
ad_datas: Arc<Mutex<Vec<String>>>,
address: Arc<Mutex<String>>,
name: Arc<Mutex<String>>,
alias: Arc<Mutex<String>>,
class: Arc<Mutex<u32>>,
is_discoverable: Arc<Mutex<bool>>,
is_pairable: Arc<Mutex<bool>>,
pairable_timeout: Arc<Mutex<u32>>,
discoverable_timeout: Arc<Mutex<u32>>,
is_discovering: Arc<Mutex<bool>>,
uuids: Arc<Mutex<Vec<String>>>,
modalias: Arc<Mutex<String>>,
}
Fields§
§id: Arc<Mutex<String>>
§is_present: Arc<Mutex<bool>>
§is_powered: Arc<Mutex<bool>>
§can_start_discovery: Arc<Mutex<bool>>
§can_stop_discovery: Arc<Mutex<bool>>
§devices: Arc<Mutex<Vec<Arc<FakeBluetoothDevice>>>>
§ad_datas: Arc<Mutex<Vec<String>>>
§address: Arc<Mutex<String>>
§name: Arc<Mutex<String>>
§alias: Arc<Mutex<String>>
§class: Arc<Mutex<u32>>
§is_discoverable: Arc<Mutex<bool>>
§is_pairable: Arc<Mutex<bool>>
§pairable_timeout: Arc<Mutex<u32>>
§discoverable_timeout: Arc<Mutex<u32>>
§is_discovering: Arc<Mutex<bool>>
§uuids: Arc<Mutex<Vec<String>>>
§modalias: Arc<Mutex<String>>
Implementations§
source§impl FakeBluetoothAdapter
impl FakeBluetoothAdapter
pub fn new( id: String, is_present: bool, is_powered: bool, can_start_discovery: bool, can_stop_discovery: bool, devices: Vec<Arc<FakeBluetoothDevice>>, ad_datas: Vec<String>, address: String, name: String, alias: String, class: u32, is_discoverable: bool, is_pairable: bool, pairable_timeout: u32, discoverable_timeout: u32, is_discovering: bool, uuids: Vec<String>, modalias: String, ) -> Arc<FakeBluetoothAdapter>
pub fn new_empty() -> Arc<FakeBluetoothAdapter>
pub fn get_id(&self) -> String
pub fn set_id(&self, value: String)
pub fn is_present(&self) -> Result<bool, Box<dyn Error>>
pub fn set_present(&self, value: bool) -> Result<(), Box<dyn Error>>
pub fn is_powered(&self) -> Result<bool, Box<dyn Error>>
pub fn set_powered(&self, value: bool) -> Result<(), Box<dyn Error>>
pub fn get_can_start_discovery(&self) -> Result<bool, Box<dyn Error>>
pub fn set_can_start_discovery(&self, value: bool) -> Result<(), Box<dyn Error>>
pub fn get_can_stop_discovery(&self) -> Result<bool, Box<dyn Error>>
pub fn set_can_stop_discovery(&self, value: bool) -> Result<(), Box<dyn Error>>
pub fn get_devices( &self, ) -> Result<Vec<Arc<FakeBluetoothDevice>>, Box<dyn Error>>
pub fn get_ad_datas(&self) -> Result<Vec<String>, Box<dyn Error>>
pub fn set_ad_datas(&self, value: Vec<String>) -> Result<(), Box<dyn Error>>
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: String) -> 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 get_class(&self) -> Result<u32, Box<dyn Error>>
pub fn set_class(&self, value: u32) -> Result<(), Box<dyn Error>>
pub fn is_discoverable(&self) -> Result<bool, Box<dyn Error>>
pub fn set_discoverable(&self, value: bool) -> Result<(), Box<dyn Error>>
pub fn is_pairable(&self) -> Result<bool, Box<dyn Error>>
pub fn set_pairable(&self, value: bool) -> Result<(), Box<dyn Error>>
pub fn get_pairable_timeout(&self) -> Result<u32, Box<dyn Error>>
pub fn set_pairable_timeout(&self, value: u32) -> Result<(), Box<dyn Error>>
pub fn get_discoverable_timeout(&self) -> Result<u32, Box<dyn Error>>
pub fn set_discoverable_timeout(&self, value: u32) -> Result<(), Box<dyn Error>>
pub fn is_discovering(&self) -> Result<bool, Box<dyn Error>>
pub fn set_discovering(&self, value: bool) -> 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 set_modalias(&self, value: String) -> Result<(), Box<dyn Error>>
pub fn get_device( &self, id: String, ) -> Result<Arc<FakeBluetoothDevice>, Box<dyn Error>>
pub fn get_device_list(&self) -> Result<Vec<String>, Box<dyn Error>>
pub fn get_first_device( &self, ) -> Result<Arc<FakeBluetoothDevice>, Box<dyn Error>>
pub fn add_device( &self, device: Arc<FakeBluetoothDevice>, ) -> Result<(), Box<dyn Error>>
pub fn remove_device(&self, id: String) -> Result<(), Box<dyn Error>>
pub fn get_first_ad_data(&self) -> Result<String, Box<dyn Error>>
pub fn create_discovery_session( &self, ) -> Result<FakeBluetoothDiscoverySession, 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>>
Trait Implementations§
source§impl Clone for FakeBluetoothAdapter
impl Clone for FakeBluetoothAdapter
source§fn clone(&self) -> FakeBluetoothAdapter
fn clone(&self) -> FakeBluetoothAdapter
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 FakeBluetoothAdapter
impl RefUnwindSafe for FakeBluetoothAdapter
impl Send for FakeBluetoothAdapter
impl Sync for FakeBluetoothAdapter
impl Unpin for FakeBluetoothAdapter
impl UnwindSafe for FakeBluetoothAdapter
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