From efe5cca9bbe4d5695dfd6a7eba449c2ea84c3d88 Mon Sep 17 00:00:00 2001 From: Alex Emmet <111742636+Alex-Emmet@users.noreply.github.com> Date: Fri, 3 Jul 2026 16:51:27 +0200 Subject: [PATCH] getFunctions --- host/src/lib.rs | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/host/src/lib.rs b/host/src/lib.rs index 9cfb5b5..89cae77 100644 --- a/host/src/lib.rs +++ b/host/src/lib.rs @@ -13,9 +13,10 @@ use tokio::time::Duration; /* ---- async callback type aliases ---- */ #[cfg(feature = "crypto")] -type GetExistingUser = Box< +pub type GetExistingUser = Box< dyn Fn( u64, + Option, ) -> Pin> + Send>> + Send @@ -23,8 +24,11 @@ type GetExistingUser = Box< >; #[cfg(feature = "crypto")] -type CompleteRegister = Box< - dyn Fn(mtp_crypto::PublicKeyBundle) -> Pin + Send>> +pub type CompleteRegister = Box< + dyn Fn( + mtp_crypto::PublicKeyBundle, + Option, + ) -> Pin + Send>> + Send + Sync, >; @@ -87,19 +91,8 @@ impl HostConfig { pub fn with_authentication( mut self, host_keyring: mtp_crypto::Keyring, - get_existing_user: impl Fn( - u64, - ) -> Pin< - Box> + Send>, - > + Send - + Sync - + 'static, - complete_register: impl Fn( - mtp_crypto::PublicKeyBundle, - ) -> Pin + Send>> - + Send - + Sync - + 'static, + get_existing_user: GetExistingUser, + complete_register: CompleteRegister, ) -> Self { self.authentication_policy = AuthenticationPolicy::ForceAuthentication; self.host_keyring = host_keyring;