pub struct RemoteClient { /* private fields */ }Implementations§
Source§impl RemoteClient
impl RemoteClient
Sourcepub async fn connect(
identity_provider: Box<dyn IdentityProvider>,
session_store: Box<dyn SessionStore>,
proxy_client: Box<dyn ProxyClient>,
) -> Result<RemoteClientHandle, ClientError>
pub async fn connect( identity_provider: Box<dyn IdentityProvider>, session_store: Box<dyn SessionStore>, proxy_client: Box<dyn ProxyClient>, ) -> Result<RemoteClientHandle, ClientError>
Connect to the proxy server, spawn the event loop, and return a handle.
This is the single entry point. After connect() returns, the client is
authenticated with the proxy and ready for pairing. Use one of the pairing
methods to establish a secure channel:
pair_with_handshake()for rendezvous-based pairingpair_with_psk()for PSK-based pairingload_cached_session()for reconnecting with a cached session
Sourcepub async fn pair_with_handshake(
&self,
rendezvous_code: String,
verify_fingerprint: bool,
) -> Result<IdentityFingerprint, ClientError>
pub async fn pair_with_handshake( &self, rendezvous_code: String, verify_fingerprint: bool, ) -> Result<IdentityFingerprint, ClientError>
Pair with a remote device using a rendezvous code.
Resolves the rendezvous code to a fingerprint, performs the Noise handshake,
and optionally waits for user fingerprint verification. If verify_fingerprint
is true, a RemoteClientRequest::VerifyFingerprint will be sent on the
request channel and must be answered before this method returns.
Sourcepub async fn pair_with_psk(
&self,
psk: Psk,
remote_fingerprint: IdentityFingerprint,
) -> Result<(), ClientError>
pub async fn pair_with_psk( &self, psk: Psk, remote_fingerprint: IdentityFingerprint, ) -> Result<(), ClientError>
Pair with a remote device using a pre-shared key.
Uses the PSK for authentication, skipping fingerprint verification since trust is established through the PSK.
Sourcepub async fn load_cached_session(
&self,
remote_fingerprint: IdentityFingerprint,
) -> Result<(), ClientError>
pub async fn load_cached_session( &self, remote_fingerprint: IdentityFingerprint, ) -> Result<(), ClientError>
Reconnect to a remote device using a cached session.
Verifies the session exists in the session store and reconnects without requiring fingerprint verification.
Sourcepub async fn request_credential(
&self,
query: &CredentialQuery,
) -> Result<CredentialData, ClientError>
pub async fn request_credential( &self, query: &CredentialQuery, ) -> Result<CredentialData, ClientError>
Request a credential over the secure channel.
Sourcepub async fn list_sessions(
&self,
) -> Result<Vec<(IdentityFingerprint, Option<String>, u64, u64)>, ClientError>
pub async fn list_sessions( &self, ) -> Result<Vec<(IdentityFingerprint, Option<String>, u64, u64)>, ClientError>
List all cached sessions.
Sourcepub async fn has_session(
&self,
fingerprint: IdentityFingerprint,
) -> Result<bool, ClientError>
pub async fn has_session( &self, fingerprint: IdentityFingerprint, ) -> Result<bool, ClientError>
Check if a session exists for a fingerprint.
Trait Implementations§
Source§impl Clone for RemoteClient
impl Clone for RemoteClient
Source§fn clone(&self) -> RemoteClient
fn clone(&self) -> RemoteClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more