pub struct UserClient { /* private fields */ }Implementations§
Source§impl UserClient
impl UserClient
Sourcepub async fn connect(
identity_provider: Box<dyn IdentityProvider>,
connection_store: Box<dyn ConnectionStore>,
proxy_client: Box<dyn ProxyClient>,
audit_log: Option<Box<dyn AuditLog>>,
psk_store: Option<Box<dyn PskStore>>,
) -> Result<UserClientHandle, ClientError>
pub async fn connect( identity_provider: Box<dyn IdentityProvider>, connection_store: Box<dyn ConnectionStore>, proxy_client: Box<dyn ProxyClient>, audit_log: Option<Box<dyn AuditLog>>, psk_store: Option<Box<dyn PskStore>>, ) -> Result<UserClientHandle, 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
already listening for incoming connections. Use get_psk_token() or
get_rendezvous_token() to set up pairings, and receive events through
the returned handle’s notification/request channels.
Pass None for audit_log to use a no-op logger.
Pass Some(store) for psk_store to enable reusable PSK support.
Stored PSKs are loaded into pending pairings on startup.
Sourcepub async fn get_psk_token(
&self,
name: Option<String>,
reusable: bool,
) -> Result<String, ClientError>
pub async fn get_psk_token( &self, name: Option<String>, reusable: bool, ) -> Result<String, ClientError>
Generate a PSK token for a new pairing.
Returns the formatted token string (<psk_hex>_<fingerprint_hex>).
Multiple PSK pairings are supported concurrently (each matched by psk_id).
When reusable is true, the PSK is saved to the configured PskStore
and will not be consumed on first use. Requires a PskStore to have been
passed to UserClient::connect().
Sourcepub async fn get_rendezvous_token(
&self,
name: Option<String>,
) -> Result<RendezvousCode, ClientError>
pub async fn get_rendezvous_token( &self, name: Option<String>, ) -> Result<RendezvousCode, ClientError>
Request a rendezvous code from the proxy for a new pairing.
Only one rendezvous pairing at a time — there’s no way to distinguish incoming rendezvous handshakes.
Trait Implementations§
Source§impl Clone for UserClient
impl Clone for UserClient
Source§fn clone(&self) -> UserClient
fn clone(&self) -> UserClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more