pub struct NativeSource { /* private fields */ }Expand description
A native device-discovery source with optional broad-scan exclusions.
The default scans all compiled device types. Exclusions apply only when
DeviceSelector::device_type is unset; explicitly naming a type still
selects it. Listing can probe emulators when requested by the selector.
If any candidates are found, listing ignores failures from other device
types; otherwise it returns the first discovery error, if any.
Implementations§
Source§impl NativeSource
impl NativeSource
Sourcepub fn excluding(excluded: impl IntoIterator<Item = DeviceType>) -> NativeSource
pub fn excluding(excluded: impl IntoIterator<Item = DeviceType>) -> NativeSource
Creates a source that omits excluded types from broad discovery.
Sourcepub fn is_supported(device_type: DeviceType) -> bool
pub fn is_supported(device_type: DeviceType) -> bool
Returns whether support for device_type was compiled into this build.
This does not check for attached devices, permissions, or usable wallets.
Trait Implementations§
Source§impl Default for NativeSource
impl Default for NativeSource
Source§fn default() -> NativeSource
fn default() -> NativeSource
Returns the “default value” for a type. Read more
Source§impl DeviceSource for NativeSource
impl DeviceSource for NativeSource
Source§type Error = NativeError
type Error = NativeError
A discovery or device-opening failure.
Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 DeviceSelector,
) -> Pin<Box<dyn Future<Output = Result<Vec<DeviceCandidate>, NativeError>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
NativeSource: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
selector: &'life1 DeviceSelector,
) -> Pin<Box<dyn Future<Output = Result<Vec<DeviceCandidate>, NativeError>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
NativeSource: 'async_trait,
Lists matching candidates, potentially probing emulators with I/O.
Source§fn open<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
candidate: &'life1 DeviceCandidate,
selector: &'life2 DeviceSelector,
pairing_code: Option<&'life3 Arc<dyn Fn(&str) + Sync + Send>>,
host_interaction: Option<&'life4 Rc<dyn Fn() -> Box<dyn HostInteraction>>>,
) -> Pin<Box<dyn Future<Output = Result<Device, NativeError>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
NativeSource: 'async_trait,
fn open<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
candidate: &'life1 DeviceCandidate,
selector: &'life2 DeviceSelector,
pairing_code: Option<&'life3 Arc<dyn Fn(&str) + Sync + Send>>,
host_interaction: Option<&'life4 Rc<dyn Fn() -> Box<dyn HostInteraction>>>,
) -> Pin<Box<dyn Future<Output = Result<Device, NativeError>> + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
NativeSource: 'async_trait,
Opens a candidate and attaches the supplied pairing and host-input callbacks. Read more
Auto Trait Implementations§
impl Freeze for NativeSource
impl RefUnwindSafe for NativeSource
impl Send for NativeSource
impl Sync for NativeSource
impl Unpin for NativeSource
impl UnsafeUnpin for NativeSource
impl UnwindSafe for NativeSource
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