pub trait ProtocolRemoteExt<R: Ratchet>: Remote<R> {
Show 16 methods
// Provided methods
fn register<'life0, 'async_trait, T, P, V, K>(
&'life0 self,
addr: T,
full_name: P,
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,
P: '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_admitted<'life0, 'async_trait, T, P, V, K>(
&'life0 self,
addr: T,
full_name: P,
username: V,
proposed_password: K,
default_security_settings: SessionSecuritySettings,
server_password: Option<PreSharedKey>,
admission: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
where T: 'async_trait + ToSocketAddrs + Send,
P: '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_to_endpoint<'life0, 'async_trait, P, V, K>(
&'life0 self,
endpoint: WebSocketEndpoint,
full_name: P,
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 P: '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_to_endpoint_admitted<'life0, 'async_trait, P, V, K>(
&'life0 self,
endpoint: WebSocketEndpoint,
full_name: P,
username: V,
proposed_password: K,
default_security_settings: SessionSecuritySettings,
server_password: Option<PreSharedKey>,
admission: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
where P: '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 server_endpoint<'life0, 'async_trait>(
&'life0 self,
cid: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<WebSocketEndpoint>, NetworkError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn register_with_defaults<'life0, 'async_trait, T, P, V, K>(
&'life0 self,
addr: T,
full_name: P,
username: V,
proposed_password: K,
) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
where T: 'async_trait + ToSocketAddrs + Send,
P: '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<CitadelClientServerConnection<R>, 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<CitadelClientServerConnection<R>, NetworkError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn find_target<'life0, 'async_trait, T, P>(
&'life0 self,
local_user: T,
peer: P,
) -> Pin<Box<dyn Future<Output = Result<SymmetricIdentifierHandleRef<'_, R>, 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 propose_target<'life0, 'async_trait, T, P>(
&'life0 self,
local_user: T,
peer: P,
) -> Pin<Box<dyn Future<Output = Result<SymmetricIdentifierHandleRef<'_, R>, 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 { ... }
fn probe_server<'life0, 'async_trait>(
&'life0 self,
cid: u64,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = ServerProbeOutcome> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn abandon_session<'life0, 'async_trait>(
&'life0 self,
cid: u64,
) -> Pin<Box<dyn Future<Output = Result<(), NetworkError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ActiveSessions, NetworkError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
fn rebind_local(&self) -> Result<RebindReport, NetworkError> { ... }
}Expand description
Endows the NodeRemote with additional functions
Provided Methods§
Sourcefn register<'life0, 'async_trait, T, P, V, K>(
&'life0 self,
addr: T,
full_name: P,
username: V,
proposed_password: K,
default_security_settings: SessionSecuritySettings,
server_password: Option<PreSharedKey>,
) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
fn register<'life0, 'async_trait, T, P, V, K>( &'life0 self, addr: T, full_name: P, username: V, proposed_password: K, default_security_settings: SessionSecuritySettings, server_password: Option<PreSharedKey>, ) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
Registers with custom settings Returns a ticket which is used to uniquely identify the request in the protocol
Sourcefn register_admitted<'life0, 'async_trait, T, P, V, K>(
&'life0 self,
addr: T,
full_name: P,
username: V,
proposed_password: K,
default_security_settings: SessionSecuritySettings,
server_password: Option<PreSharedKey>,
admission: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
fn register_admitted<'life0, 'async_trait, T, P, V, K>( &'life0 self, addr: T, full_name: P, username: V, proposed_password: K, default_security_settings: SessionSecuritySettings, server_password: Option<PreSharedKey>, admission: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
As register, carrying an admission token (a Turnstile response) for a
server that asks fresh registrations for one. A refusal is a PqSignInAdmissionRequired
or PqSignInAdmissionFailed error.
Sourcefn register_to_endpoint<'life0, 'async_trait, P, V, K>(
&'life0 self,
endpoint: WebSocketEndpoint,
full_name: P,
username: V,
proposed_password: K,
default_security_settings: SessionSecuritySettings,
server_password: Option<PreSharedKey>,
) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
fn register_to_endpoint<'life0, 'async_trait, P, V, K>( &'life0 self, endpoint: WebSocketEndpoint, full_name: P, username: V, proposed_password: K, default_security_settings: SessionSecuritySettings, server_password: Option<PreSharedKey>, ) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
Registers with a server reached by a WebSocket URL (wss://org.example.net/, or
ws://host:port/path) rather than at an address of its own: a server behind an HTTP edge,
which is told apart from the edge’s other servers by hostname and path. The account
remembers the URL, so a later connect with credentials dials it too.
Sourcefn register_to_endpoint_admitted<'life0, 'async_trait, P, V, K>(
&'life0 self,
endpoint: WebSocketEndpoint,
full_name: P,
username: V,
proposed_password: K,
default_security_settings: SessionSecuritySettings,
server_password: Option<PreSharedKey>,
admission: Option<String>,
) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
fn register_to_endpoint_admitted<'life0, 'async_trait, P, V, K>( &'life0 self, endpoint: WebSocketEndpoint, full_name: P, username: V, proposed_password: K, default_security_settings: SessionSecuritySettings, server_password: Option<PreSharedKey>, admission: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
As register_to_endpoint, carrying an admission token.
Sourcefn server_endpoint<'life0, 'async_trait>(
&'life0 self,
cid: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<WebSocketEndpoint>, NetworkError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn server_endpoint<'life0, 'async_trait>(
&'life0 self,
cid: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<WebSocketEndpoint>, NetworkError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
The WebSocket URL the local account cid registered to (see
register_to_endpoint), or None when its server is the
address in its connection info. Behind an HTTP edge that address is one of the edge’s,
shared with every other server there, so it does not identify the server; this does.
Sourcefn register_with_defaults<'life0, 'async_trait, T, P, V, K>(
&'life0 self,
addr: T,
full_name: P,
username: V,
proposed_password: K,
) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + 'async_trait>>
fn register_with_defaults<'life0, 'async_trait, T, P, V, K>( &'life0 self, addr: T, full_name: P, username: V, proposed_password: K, ) -> Pin<Box<dyn Future<Output = Result<RegisterSuccess, NetworkError>> + Send + '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
Sourcefn 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<CitadelClientServerConnection<R>, NetworkError>> + Send + 'async_trait>>where
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<CitadelClientServerConnection<R>, 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
Sourcefn connect_with_defaults<'life0, 'async_trait>(
&'life0 self,
auth: AuthenticationRequest,
) -> Pin<Box<dyn Future<Output = Result<CitadelClientServerConnection<R>, 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<CitadelClientServerConnection<R>, 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
Never displaces a session the server already holds for the account
(ConnectMode::Standard { force_login: false }). A client reconnecting after its link
dropped should use Self::connect with force_login: true: see ConnectMode.
Sourcefn find_target<'life0, 'async_trait, T, P>(
&'life0 self,
local_user: T,
peer: P,
) -> Pin<Box<dyn Future<Output = Result<SymmetricIdentifierHandleRef<'_, R>, 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 find_target<'life0, 'async_trait, T, P>(
&'life0 self,
local_user: T,
peer: P,
) -> Pin<Box<dyn Future<Output = Result<SymmetricIdentifierHandleRef<'_, R>, 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 valid target identifier used to make protocol requests. Raw user IDs or usernames can be used
use citadel_sdk::prelude::*;
let server_connection_settings = DefaultServerConnectionSettingsBuilder::credentialed_login("127.0.0.1:25021", "john.doe", "password").build().unwrap();
conn.find_target("my_account", "my_peer").await?.send_file("/path/to/file.pdf").await
// or: conn.find_target(1234, "my_peer").await? [...]Sourcefn propose_target<'life0, 'async_trait, T, P>(
&'life0 self,
local_user: T,
peer: P,
) -> Pin<Box<dyn Future<Output = Result<SymmetricIdentifierHandleRef<'_, R>, 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 propose_target<'life0, 'async_trait, T, P>(
&'life0 self,
local_user: T,
peer: P,
) -> Pin<Box<dyn Future<Output = Result<SymmetricIdentifierHandleRef<'_, R>, 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
Sourcefn 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_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
Sourcefn 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,
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
Sourcefn probe_server<'life0, 'async_trait>(
&'life0 self,
cid: u64,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = ServerProbeOutcome> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn probe_server<'life0, 'async_trait>(
&'life0 self,
cid: u64,
timeout: Duration,
) -> Pin<Box<dyn Future<Output = ServerProbeOutcome> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Round-trips an authenticated probe to the server of session cid now, rather than on the
keep-alive schedule (15 minutes, 45 to time out): Ok(rtt), Timeout when no answer came
within timeout, or Error when it could not be sent (no such connected session, or a
server below protocol 0.12.1, which cannot answer one). Over a WebSocket the probe also
sends a WebSocket ping.
Sourcefn abandon_session<'life0, 'async_trait>(
&'life0 self,
cid: u64,
) -> Pin<Box<dyn Future<Output = Result<(), NetworkError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn abandon_session<'life0, 'async_trait>(
&'life0 self,
cid: u64,
) -> Pin<Box<dyn Future<Output = Result<(), NetworkError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Ends session cid here and now, without asking the server: its transport is dropped, the
session is forgotten and its CID freed, so the next login is not refused with “Session for
CID .. already exists”. For a link that died silently (after probe_server timed out):
the server’s copy is replaced by that login’s resume token. Resolves once the session has
dropped; Err when this node holds no session for cid.
Sourcefn sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ActiveSessions, NetworkError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ActiveSessions, NetworkError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Returns all the active sessions in the protocol, including all P2P connections hierarchically placed as children to C2S connections
Sourcefn rebind_local(&self) -> Result<RebindReport, NetworkError>
fn rebind_local(&self) -> Result<RebindReport, NetworkError>
Moves this node’s live client-role QUIC endpoints to fresh sockets on the current local
address, so Direct and TURN QUIC paths (and a C2S QUIC connection) migrate without a new
handshake. Call it on a local network change. Local only, so not version-gated; see
NodeRemote::rebind_local.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".