Struct ScanConfig

Source
pub struct ScanConfig { /* private fields */ }

Implementations§

Source§

impl ScanConfig

Source

pub fn adapter_index(self, index: usize) -> Self

Index of bluetooth adapter to use

Source

pub fn with_filters(self, filters: &[Filter]) -> Self

Source

pub fn filter_by_address( self, func: impl Fn(&str, &str) -> bool + Send + Sync + 'static, ) -> Self

Filter scanned devices based on the device address

Source

pub fn filter_by_name( self, func: impl Fn(&str, &str) -> bool + Send + Sync + 'static, ) -> Self

Filter scanned devices based on the device name

Source

pub fn filter_by_rssi( self, func: impl Fn(i16, i16) -> bool + Send + Sync + 'static, ) -> Self

Source

pub fn filter_by_service( self, func: impl Fn(&Vec<Uuid>, &Uuid) -> bool + Send + Sync + 'static, ) -> Self

Source

pub fn filter_by_characteristics( self, func: impl Fn(&Vec<Uuid>, &Uuid) -> bool + Send + Sync + 'static, ) -> Self

Filter scanned devices based on available characteristics

Source

pub fn stop_after_matches(self, max_results: usize) -> Self

Stop the scan after given number of matches

Source

pub fn stop_after_first_match(self) -> Self

Stop the scan after the first match

Source

pub fn stop_after_timeout(self, timeout: Duration) -> Self

Stop the scan after given duration

Source

pub fn force_disconnect(self, force_disconnect: bool) -> Self

Source

pub fn require_name(self) -> Self

Require that the scanned devices have a name

Trait Implementations§

Source§

impl Default for ScanConfig

Source§

fn default() -> ScanConfig

Returns the “default value” for a type. 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, 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.