parent
eff96ed72f
commit
efe5cca9bb
1 changed files with 9 additions and 16 deletions
|
|
@ -13,9 +13,10 @@ use tokio::time::Duration;
|
||||||
|
|
||||||
/* ---- async callback type aliases ---- */
|
/* ---- async callback type aliases ---- */
|
||||||
#[cfg(feature = "crypto")]
|
#[cfg(feature = "crypto")]
|
||||||
type GetExistingUser = Box<
|
pub type GetExistingUser = Box<
|
||||||
dyn Fn(
|
dyn Fn(
|
||||||
u64,
|
u64,
|
||||||
|
Option<String>,
|
||||||
)
|
)
|
||||||
-> Pin<Box<dyn std::future::Future<Output = Option<mtp_crypto::PublicKeyBundle>> + Send>>
|
-> Pin<Box<dyn std::future::Future<Output = Option<mtp_crypto::PublicKeyBundle>> + Send>>
|
||||||
+ Send
|
+ Send
|
||||||
|
|
@ -23,8 +24,11 @@ type GetExistingUser = Box<
|
||||||
>;
|
>;
|
||||||
|
|
||||||
#[cfg(feature = "crypto")]
|
#[cfg(feature = "crypto")]
|
||||||
type CompleteRegister = Box<
|
pub type CompleteRegister = Box<
|
||||||
dyn Fn(mtp_crypto::PublicKeyBundle) -> Pin<Box<dyn std::future::Future<Output = u64> + Send>>
|
dyn Fn(
|
||||||
|
mtp_crypto::PublicKeyBundle,
|
||||||
|
Option<String>,
|
||||||
|
) -> Pin<Box<dyn std::future::Future<Output = u64> + Send>>
|
||||||
+ Send
|
+ Send
|
||||||
+ Sync,
|
+ Sync,
|
||||||
>;
|
>;
|
||||||
|
|
@ -87,19 +91,8 @@ impl HostConfig {
|
||||||
pub fn with_authentication(
|
pub fn with_authentication(
|
||||||
mut self,
|
mut self,
|
||||||
host_keyring: mtp_crypto::Keyring,
|
host_keyring: mtp_crypto::Keyring,
|
||||||
get_existing_user: impl Fn(
|
get_existing_user: GetExistingUser,
|
||||||
u64,
|
complete_register: CompleteRegister,
|
||||||
) -> Pin<
|
|
||||||
Box<dyn std::future::Future<Output = Option<mtp_crypto::PublicKeyBundle>> + Send>,
|
|
||||||
> + Send
|
|
||||||
+ Sync
|
|
||||||
+ 'static,
|
|
||||||
complete_register: impl Fn(
|
|
||||||
mtp_crypto::PublicKeyBundle,
|
|
||||||
) -> Pin<Box<dyn std::future::Future<Output = u64> + Send>>
|
|
||||||
+ Send
|
|
||||||
+ Sync
|
|
||||||
+ 'static,
|
|
||||||
) -> Self {
|
) -> Self {
|
||||||
self.authentication_policy = AuthenticationPolicy::ForceAuthentication;
|
self.authentication_policy = AuthenticationPolicy::ForceAuthentication;
|
||||||
self.host_keyring = host_keyring;
|
self.host_keyring = host_keyring;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue