Trait webauthn_authenticator_rs::transport::Token
source · pub trait Token: Sized + Debug + Sync + Send {
type Id: Sized + Debug + Sync + Send;
// Required methods
fn get_transport(&self) -> AuthenticatorTransport;
fn transmit_raw<'life0, 'life1, 'life2, 'async_trait, U>(
&'life0 mut self,
cbor: &'life1 [u8],
ui: &'life2 U
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, WebauthnCError>> + Send + 'async_trait>>
where U: UiCallback + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn cancel<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn init<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn close<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn has_button(&self) -> bool { ... }
fn transmit<'a, 'life0, 'life1, 'async_trait, C, R, U>(
&'life0 mut self,
cmd: C,
ui: &'life1 U
) -> Pin<Box<dyn Future<Output = Result<R, WebauthnCError>> + Send + 'async_trait>>
where C: CBORCommand<Response = R> + 'async_trait,
R: CBORResponse + 'async_trait,
U: UiCallback + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Available on crate feature
ctap2 only.Expand description
Represents a connection to a single FIDO token over a Transport.
This is a low level interface to FIDO tokens, passing raw messages. crate::ctap2 provides a higher level abstraction.
Required Associated Types§
Required Methods§
sourcefn get_transport(&self) -> AuthenticatorTransport
fn get_transport(&self) -> AuthenticatorTransport
Gets the transport layer used for communication with this token.
sourcefn transmit_raw<'life0, 'life1, 'life2, 'async_trait, U>(
&'life0 mut self,
cbor: &'life1 [u8],
ui: &'life2 U
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, WebauthnCError>> + Send + 'async_trait>>where
U: UiCallback + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn transmit_raw<'life0, 'life1, 'life2, 'async_trait, U>(
&'life0 mut self,
cbor: &'life1 [u8],
ui: &'life2 U
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, WebauthnCError>> + Send + 'async_trait>>where
U: UiCallback + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Transmits a command on the underlying transport.
cbor is a CBOR-encoded command.
Interfaces need to check for and return any transport-layer-specific error code WebauthnCError::Ctap, but don’t need to worry about deserialising CBOR.
sourcefn cancel<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cancel<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), WebauthnCError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Cancels a pending request.
Provided Methods§
sourcefn transmit<'a, 'life0, 'life1, 'async_trait, C, R, U>(
&'life0 mut self,
cmd: C,
ui: &'life1 U
) -> Pin<Box<dyn Future<Output = Result<R, WebauthnCError>> + Send + 'async_trait>>where
C: CBORCommand<Response = R> + 'async_trait,
R: CBORResponse + 'async_trait,
U: UiCallback + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn transmit<'a, 'life0, 'life1, 'async_trait, C, R, U>(
&'life0 mut self,
cmd: C,
ui: &'life1 U
) -> Pin<Box<dyn Future<Output = Result<R, WebauthnCError>> + Send + 'async_trait>>where
C: CBORCommand<Response = R> + 'async_trait,
R: CBORResponse + 'async_trait,
U: UiCallback + 'async_trait,
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Transmit a CBOR message to a token, and deserialises the response.
Object Safety§
This trait is not object safe.
Implementors§
source§impl Token for BluetoothToken
Available on crate feature bluetooth only.
impl Token for BluetoothToken
Available on crate feature
bluetooth only.type Id = PeripheralId
source§impl Token for USBToken
Available on crate feature usb only.
impl Token for USBToken
Available on crate feature
usb only.