-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathclient.rs
More file actions
30 lines (26 loc) · 1.06 KB
/
client.rs
File metadata and controls
30 lines (26 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use std::pin::Pin;
use futures_lite::Stream;
use crate::{
model::Device,
server::{BackgroundEvent, RequestId},
};
/// Used for communication from trusted UI to credential service
pub trait FlowController {
fn get_available_public_key_devices(
&self,
) -> impl Future<Output = Result<Vec<Device>, ()>> + Send;
fn get_hybrid_credential(&mut self) -> impl Future<Output = Result<(), ()>> + Send;
fn get_usb_credential(&mut self) -> impl Future<Output = Result<(), ()>> + Send;
fn get_nfc_credential(&mut self) -> impl Future<Output = Result<(), ()>> + Send;
fn subscribe(
&mut self,
) -> impl Future<
Output = Result<Pin<Box<dyn Stream<Item = BackgroundEvent> + Send + 'static>>, ()>,
> + Send;
fn enter_client_pin(&mut self, pin: String) -> impl Future<Output = Result<(), ()>> + Send;
fn select_credential(
&self,
credential_id: String,
) -> impl Future<Output = Result<(), ()>> + Send;
fn cancel_request(&self, request_id: RequestId) -> impl Future<Output = Result<(), ()>> + Send;
}