citadel_sdk::remote_ext

Trait ProtocolRemoteExt

source
pub trait ProtocolRemoteExt: Remote {
    // Provided methods
    fn register<'life0, 'async_trait, T, R, V, K>(
        &'life0 self,
        addr: T,
        full_name: R,
        username: V,
        proposed_password: K,
        default_security_settings: SessionSecuritySettings,
        server_password: Option<PreSharedKey>,
    ) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
       where T: 'async_trait + ToSocketAddrs + Send,
             R: 'async_trait + Into<String> + Send,
             V: 'async_trait + Into<String> + Send,
             K: 'async_trait + Into<SecBuffer> + Send,
             Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn register_with_defaults<'life0, 'async_trait, T, R, V, K>(
        &'life0 self,
        addr: T,
        full_name: R,
        username: V,
        proposed_password: K,
    ) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
       where T: 'async_trait + ToSocketAddrs + Send,
             R: 'async_trait + Into<String> + Send,
             V: 'async_trait + Into<String> + Send,
             K: 'async_trait + Into<SecBuffer> + Send,
             Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn connect<'life0, 'async_trait>(
        &'life0 self,
        auth: AuthenticationRequest,
        connect_mode: ConnectMode,
        udp_mode: UdpMode,
        keep_alive_timeout: Option<Duration>,
        session_security_settings: SessionSecuritySettings,
        server_password: Option<PreSharedKey>,
    ) -> Pin<Box<dyn Future<Output = Result<ConnectionSuccess, NetworkError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn connect_with_defaults<'life0, 'async_trait>(
        &'life0 self,
        auth: AuthenticationRequest,
    ) -> Pin<Box<dyn Future<Output = Result<ConnectionSuccess, NetworkError>> + Send + 'async_trait>>
       where Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn find_target<'life0, 'async_trait, T, R>(
        &'life0 self,
        local_user: T,
        peer: R,
    ) -> Pin<Box<dyn Future<Output = Result<SymmetricIdentifierHandleRef<'_>, NetworkError>> + Send + 'async_trait>>
       where T: 'async_trait + Into<UserIdentifier> + Send,
             R: 'async_trait + Into<UserIdentifier> + Send,
             Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn propose_target<'life0, 'async_trait, T, P>(
        &'life0 self,
        local_user: T,
        peer: P,
    ) -> Pin<Box<dyn Future<Output = Result<SymmetricIdentifierHandleRef<'_>, NetworkError>> + Send + 'async_trait>>
       where T: 'async_trait + Into<UserIdentifier> + Send,
             P: 'async_trait + Into<UserIdentifier> + Send,
             Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_local_group_peers<'life0, 'async_trait, T>(
        &'life0 self,
        local_user: T,
        limit: Option<usize>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<LocalGroupPeerFullInfo>, NetworkError>> + Send + 'async_trait>>
       where T: 'async_trait + Into<UserIdentifier> + Send,
             Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
    fn get_local_group_mutual_peers<'life0, 'async_trait, T>(
        &'life0 self,
        local_user: T,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<LocalGroupPeerFullInfo>, NetworkError>> + Send + 'async_trait>>
       where T: 'async_trait + Into<UserIdentifier> + Send,
             Self: Sync + 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

Endows the NodeRemote with additional functions

Provided Methods§

source

fn register<'life0, 'async_trait, T, R, V, K>( &'life0 self, addr: T, full_name: R, username: V, proposed_password: K, default_security_settings: SessionSecuritySettings, server_password: Option<PreSharedKey>, ) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
where T: 'async_trait + ToSocketAddrs + Send, R: 'async_trait + Into<String> + Send, V: 'async_trait + Into<String> + Send, K: 'async_trait + Into<SecBuffer> + Send, Self: Sync + 'async_trait, 'life0: 'async_trait,

Registers with custom settings Returns a ticket which is used to uniquely identify the request in the protocol

source

fn register_with_defaults<'life0, 'async_trait, T, R, V, K>( &'life0 self, addr: T, full_name: R, username: V, proposed_password: K, ) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
where T: 'async_trait + ToSocketAddrs + Send, R: 'async_trait + Into<String> + Send, V: 'async_trait + Into<String> + Send, K: 'async_trait + Into<SecBuffer> + Send, Self: Sync + 'async_trait, 'life0: 'async_trait,

Registers using the default settings. The default uses No Google FCM keys and the default session security settings Returns a ticket which is used to uniquely identify the request in the protocol

source

fn connect<'life0, 'async_trait>( &'life0 self, auth: AuthenticationRequest, connect_mode: ConnectMode, udp_mode: UdpMode, keep_alive_timeout: Option<Duration>, session_security_settings: SessionSecuritySettings, server_password: Option<PreSharedKey>, ) -> Pin<Box<dyn Future<Output = Result<ConnectionSuccess, NetworkError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Connects with custom settings Returns a ticket which is used to uniquely identify the request in the protocol

source

fn connect_with_defaults<'life0, 'async_trait>( &'life0 self, auth: AuthenticationRequest, ) -> Pin<Box<dyn Future<Output = Result<ConnectionSuccess, NetworkError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Connects with the default settings If FCM keys were created during the registration phase, then those keys will be used for the session. If new FCM keys need to be used, consider using Self::connect

source

fn find_target<'life0, 'async_trait, T, R>( &'life0 self, local_user: T, peer: R, ) -> Pin<Box<dyn Future<Output = Result<SymmetricIdentifierHandleRef<'_>, NetworkError>> + Send + 'async_trait>>
where T: 'async_trait + Into<UserIdentifier> + Send, R: 'async_trait + Into<UserIdentifier> + Send, Self: Sync + 'async_trait, 'life0: 'async_trait,

Creates a valid target identifier used to make protocol requests. Raw user IDs or usernames can be used

use citadel_sdk::prelude::*;

let server_connection_settings = ServerConnectionSettingsBuilder::credentialed_login("127.0.0.1:25021", "john.doe", "password").build().unwrap();

remote.find_target("my_account", "my_peer").await?.send_file("/path/to/file.pdf").await
// or: remote.find_target(1234, "my_peer").await? [...]
source

fn propose_target<'life0, 'async_trait, T, P>( &'life0 self, local_user: T, peer: P, ) -> Pin<Box<dyn Future<Output = Result<SymmetricIdentifierHandleRef<'_>, NetworkError>> + Send + 'async_trait>>
where T: 'async_trait + Into<UserIdentifier> + Send, P: 'async_trait + Into<UserIdentifier> + Send, Self: Sync + 'async_trait, 'life0: 'async_trait,

Creates a proposed target from the valid local user to an unregistered peer in the network. Used when creating registration requests for peers. Currently only supports LocalGroup <-> LocalGroup peer connections

source

fn get_local_group_peers<'life0, 'async_trait, T>( &'life0 self, local_user: T, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Vec<LocalGroupPeerFullInfo>, NetworkError>> + Send + 'async_trait>>
where T: 'async_trait + Into<UserIdentifier> + Send, Self: Sync + 'async_trait, 'life0: 'async_trait,

Returns a list of local group peers on the network for local_user. May or may not be registered to the user. To get a list of registered users to local_user, run Self::get_local_group_mutual_peers

  • limit: if None, all peers are obtained. If Some, at most the specified number of peers will be obtained
source

fn get_local_group_mutual_peers<'life0, 'async_trait, T>( &'life0 self, local_user: T, ) -> Pin<Box<dyn Future<Output = Result<Vec<LocalGroupPeerFullInfo>, NetworkError>> + Send + 'async_trait>>
where T: 'async_trait + Into<UserIdentifier> + Send, Self: Sync + 'async_trait, 'life0: 'async_trait,

Returns a list of mutually-registered peers with the local_user

Object Safety§

This trait is not object safe.

Implementors§