summaryrefslogtreecommitdiffstats
path: root/third_party/rust/authenticator/src/stub/transaction.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/authenticator/src/stub/transaction.rs')
-rw-r--r--third_party/rust/authenticator/src/stub/transaction.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/third_party/rust/authenticator/src/stub/transaction.rs b/third_party/rust/authenticator/src/stub/transaction.rs
new file mode 100644
index 0000000000..bdf48ef56d
--- /dev/null
+++ b/third_party/rust/authenticator/src/stub/transaction.rs
@@ -0,0 +1,31 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+use crate::errors;
+use crate::statecallback::StateCallback;
+
+pub struct Transaction {}
+
+impl Transaction {
+ pub fn new<F, T>(
+ timeout: u64,
+ callback: StateCallback<crate::Result<T>>,
+ new_device_cb: F,
+ ) -> crate::Result<Self>
+ where
+ F: Fn(String, &dyn Fn() -> bool),
+ {
+ callback.call(Err(errors::AuthenticatorError::U2FToken(
+ errors::U2FTokenError::NotSupported,
+ )));
+
+ Err(errors::AuthenticatorError::U2FToken(
+ errors::U2FTokenError::NotSupported,
+ ))
+ }
+
+ pub fn cancel(&mut self) {
+ /* No-op. */
+ }
+}