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

source

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>

source

pub fn new_empty() -> Arc<FakeBluetoothAdapter>

source

pub fn get_id(&self) -> String

source

pub fn set_id(&self, value: String)

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

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: String) -> 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 get_class(&self) -> Result<u32, Box<dyn Error>>

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

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

source

pub fn set_discovering(&self, value: bool) -> 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 set_modalias(&self, value: String) -> Result<(), Box<dyn Error>>

source

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

source

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

source

pub fn get_first_device( &self, ) -> Result<Arc<FakeBluetoothDevice>, Box<dyn Error>>

source

pub fn add_device( &self, device: Arc<FakeBluetoothDevice>, ) -> Result<(), Box<dyn Error>>

source

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

source

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

source

pub fn create_discovery_session( &self, ) -> Result<FakeBluetoothDiscoverySession, 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>>

Trait Implementations§

source§

impl Clone for FakeBluetoothAdapter

source§

fn clone(&self) -> FakeBluetoothAdapter

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 FakeBluetoothAdapter

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.