pub struct BitBox<R: Runtime> { /* private fields */ }Expand description
BitBox client. See from_hid_device().
Implementations§
Source§impl<R: Runtime> BitBox<R>
impl<R: Runtime> BitBox<R>
Sourcepub async fn from_transport(
transport: Box<dyn ReadWrite>,
noise_config: Box<dyn NoiseConfig>,
) -> Result<BitBox<R>, Error>
pub async fn from_transport( transport: Box<dyn ReadWrite>, noise_config: Box<dyn NoiseConfig>, ) -> Result<BitBox<R>, Error>
Creates a new BitBox instance from a custom transport.
The transport is a raw byte channel to the device (HID reports); this method wraps it
in the U2F-HID framing layer internally, so callers only need to implement
ReadWrite over their platform-specific transport.
This enables use cases where USB I/O must be delegated to platform-specific code
(e.g., Android, where USB access requires Java APIs unavailable to hidapi).
Sourcepub async fn unlock_and_pair(self) -> Result<PairingBitBox<R>, Error>
pub async fn unlock_and_pair(self) -> Result<PairingBitBox<R>, Error>
Invokes the device unlock and pairing.
Auto Trait Implementations§
impl<R> !RefUnwindSafe for BitBox<R>
impl<R> !Send for BitBox<R>
impl<R> !Sync for BitBox<R>
impl<R> !UnwindSafe for BitBox<R>
impl<R> Freeze for BitBox<R>
impl<R> Unpin for BitBox<R>where
R: Unpin,
impl<R> UnsafeUnpin for BitBox<R>
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