pub struct UserClient { /* private fields */ }Expand description
User client for acting as trusted device
Implementations§
Source§impl UserClient
impl UserClient
Sourcepub async fn listen(
identity_provider: Box<dyn IdentityProvider>,
session_store: Box<dyn SessionStore>,
proxy_client: Box<dyn ProxyClient>,
) -> Result<Self, RemoteClientError>
pub async fn listen( identity_provider: Box<dyn IdentityProvider>, session_store: Box<dyn SessionStore>, proxy_client: Box<dyn ProxyClient>, ) -> Result<Self, RemoteClientError>
Connect to proxy server and return a connected client
This is an associated function (constructor) that:
- Creates the client with provided identity provider and session store
- Connects to the proxy server
- Returns a connected client ready for
enable_pskorenable_rendezvous
Sourcepub fn with_audit_log(self, audit_log: Box<dyn AuditLog>) -> Self
pub fn with_audit_log(self, audit_log: Box<dyn AuditLog>) -> Self
Set a custom audit logger. If not called, a no-op logger is used.
Sourcepub async fn listen_cached_only(
&mut self,
event_tx: Sender<UserClientEvent>,
response_rx: Receiver<UserClientResponse>,
) -> Result<(), RemoteClientError>
pub async fn listen_cached_only( &mut self, event_tx: Sender<UserClientEvent>, response_rx: Receiver<UserClientResponse>, ) -> Result<(), RemoteClientError>
Listen for cached sessions only (no new pairing code generated)
Emits a Listening event and runs the event loop. Cached sessions can still reconnect via the normal handshake/credential request flow.
Sourcepub async fn enable_psk(
&mut self,
event_tx: Sender<UserClientEvent>,
response_rx: Receiver<UserClientResponse>,
) -> Result<(), RemoteClientError>
pub async fn enable_psk( &mut self, event_tx: Sender<UserClientEvent>, response_rx: Receiver<UserClientResponse>, ) -> Result<(), RemoteClientError>
Enable PSK mode and run the event loop
Generates a PSK and token, emits events, and runs the main event loop.
Sourcepub async fn enable_rendezvous(
&mut self,
event_tx: Sender<UserClientEvent>,
response_rx: Receiver<UserClientResponse>,
) -> Result<(), RemoteClientError>
pub async fn enable_rendezvous( &mut self, event_tx: Sender<UserClientEvent>, response_rx: Receiver<UserClientResponse>, ) -> Result<(), RemoteClientError>
Enable rendezvous mode and run the event loop
Requests a rendezvous code from the proxy, emits events, and runs the main event loop.
Sourcepub fn rendezvous_code(&self) -> Option<&RendezvousCode>
pub fn rendezvous_code(&self) -> Option<&RendezvousCode>
Get the current rendezvous code
Sourcepub fn set_pending_session_name(&mut self, name: String)
pub fn set_pending_session_name(&mut self, name: String)
Set a friendly name to assign to the next newly-paired session
Auto Trait Implementations§
impl Freeze for UserClient
impl !RefUnwindSafe for UserClient
impl Send for UserClient
impl Sync for UserClient
impl Unpin for UserClient
impl UnsafeUnpin for UserClient
impl !UnwindSafe for UserClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more