pub async fn join_realm_with_authentication<
        Realm,
        AuthenticationId,
        AuthenticationChallengeHandler,
        AuthenticationChallengeHandlerResponse,
    >(
        &mut self,
        realm: Realm,
        authentication_methods: Vec<AuthenticationMethod>,
        authentication_id: AuthenticationId,
        on_challenge_handler: AuthenticationChallengeHandler,
    ) -> Result<(), WampError>
    where
        Realm: Into<String>,
        AuthenticationId: Into<String>,
        AuthenticationChallengeHandler: Fn(AuthenticationMethod, WampDict) -> AuthenticationChallengeHandlerResponse
            + Send
            + Sync
            + 'a,
        AuthenticationChallengeHandlerResponse: std::future::Future<Output = Result<AuthenticationChallengeResponse, WampError>>
            + Send
            + 'a,
    {
        self.inner_join_realm(
            realm.into(),
            authentication_methods,
            Some(authentication_id.into()),
            Some(Box::new(move |authentication_method, extra| {
                Box::pin(on_challenge_handler(authentication_method, extra))
            })),
        )
        .await
    }
/// Attempts to join a realm and start a session with the server.
///
/// * `realm` - A name of the WAMP realm
/// * `authentication_methods` - A set of all the authentication methods the client will support
/// * `authentication_id` - An authentication ID (e.g. username) the client wishes to authenticate as.
///   It is required for non-anynomous authentication methods.
/// * `on_challenge_handler` - An authentication handler function
///
/// ```ignore
/// client
///     .join_realm_with_authentication(
///         "realm1",
///         vec![wamp_async::AuthenticationMethod::Ticket],
///         "username",
///         |_authentication_method, _extra| async {
///             Ok(wamp_async::AuthenticationChallengeResponse::with_signature(
///                 "password".into(),
///             ))
///         },
///     )
///     .await?;
/// ```
Attempts to join a realm and start a session with the server.


Attempts to join a realm and start a session with the server .
pub async fn join_realm_with_authentication<
        Realm,
        AuthenticationId,
        AuthenticationChallengeHandler,
        AuthenticationChallengeHandlerResponse,
    >(
        &mut self,
        realm: Realm,
        authentication_methods: Vec<AuthenticationMethod>,
        authentication_id: AuthenticationId,
        on_challenge_handler: AuthenticationChallengeHandler,
    ) -> Result<(), WampError>
    where
        Realm: Into<String>,
        AuthenticationId: Into<String>,
        AuthenticationChallengeHandler: Fn(AuthenticationMethod, WampDict) -> AuthenticationChallengeHandlerResponse
            + Send
            + Sync
            + 'a,
        AuthenticationChallengeHandlerResponse: std::future::Future<Output = Result<AuthenticationChallengeResponse, WampError>>
            + Send
            + 'a,
    {
        self.inner_join_realm(
            realm.into(),
            authentication_methods,
            Some(authentication_id.into()),
            Some(Box::new(move |authentication_method, extra| {
                Box::pin(on_challenge_handler(authentication_method, extra))
            })),
        )
        .await
    }
pub async fn join_realm_with_authentication < Realm , AuthenticationId , AuthenticationChallengeHandler , AuthenticationChallengeHandlerResponse , > ( & mut self , realm : Realm , authentication_methods : Vec < AuthenticationMethod > , authentication_id : AuthenticationId , on_challenge_handler : AuthenticationChallengeHandler , ) -> Result < ( ) , WampError > where Realm : Into < String > , AuthenticationId : Into < String > , AuthenticationChallengeHandler : Fn ( AuthenticationMethod , WampDict ) -> AuthenticationChallengeHandlerResponse + Send + Sync + ' a , AuthenticationChallengeHandlerResponse : std :: future :: Future < Output = Result < AuthenticationChallengeResponse , WampError > > + Send + ' a , { self . inner_join_realm ( realm . into ( ) , authentication_methods , Some ( authentication_id . into ( ) ) , Some ( Box :: new ( move | authentication_method , extra | { Box :: pin ( on_challenge_handler ( authentication_method , extra ) ) } ) ) , ) . await }
Attempts to join a realm and start a session with the server.
Attempts to join a realm and start a session with the server .
&mut self
realm
Realm
authentication_methods
Vec<AuthenticationMethod>
authentication_id
AuthenticationId
on_challenge_handler
AuthenticationChallengeHandler