Debian Codegraph @

third_party/rust/authenticator/src/transport/mock/transaction.rs

raw
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 use crate::statecallback::StateCallback;
6 use crate::transport::device_selector::{DeviceBuildParameters, DeviceSelectorEvent};
7 use std::sync::mpsc::Sender;
8
9 pub struct Transaction {}
10
11 impl Transaction {
12 pub fn new<F, T>(
13 _timeout: u64,
14 _callback: StateCallback<crate::Result<T>>,
15 _status: Sender<crate::StatusUpdate>,
16 _new_device_cb: F,
17 ) -> crate::Result<Self>
18 where
19 F: Fn(
20 DeviceBuildParameters,
21 Sender<DeviceSelectorEvent>,
22 Sender<crate::StatusUpdate>,
23 &dyn Fn() -> bool,
24 ) + Sync
25 + Send
26 + 'static,
27 T: 'static,
28 {
29 Ok(Self {})
30 }
31
32 pub fn cancel(&mut self) {
33 info!("Transaction was cancelled.");
34 }
35 }