Skip to main content

RemoteClient

Struct RemoteClient 

Source
pub struct RemoteClient { /* private fields */ }
Expand description

Remote client for connecting to a user-client through a proxy

Implementations§

Source§

impl RemoteClient

Source

pub async fn new( identity_provider: Box<dyn IdentityProvider>, session_store: Box<dyn SessionStore>, event_tx: Sender<RemoteClientEvent>, response_rx: Receiver<RemoteClientResponse>, proxy_client: Box<dyn ProxyClient>, ) -> Result<Self, RemoteClientError>

Create a new remote client and connect to the proxy server

This establishes the WebSocket connection and authenticates with the proxy. After calling this, use one of the pairing methods:

  • pair_with_handshake() for new rendezvous-based pairing
  • pair_with_psk() for PSK-based pairing
  • load_cached_session() for reconnecting with a cached session
§Arguments
  • identity_provider - Provider for the client’s identity
  • session_store - Store for caching sessions
  • event_tx - Channel sender for client events
  • response_rx - Channel receiver for client responses
  • proxy_client - The proxy client implementation to use for communication
Source

pub async fn pair_with_handshake( &mut self, rendezvous_code: &str, verify_fingerprint: bool, ) -> Result<IdentityFingerprint, RemoteClientError>

Pair with a remote device using a rendezvous code

This resolves the rendezvous code to a fingerprint, performs the Noise handshake, and optionally waits for user fingerprint verification.

§Arguments
  • rendezvous_code - The rendezvous code to resolve
  • verify_fingerprint - If true, emit fingerprint event and wait for user verification. If false, emit fingerprint event informationally and proceed immediately.
Source

pub async fn pair_with_psk( &mut self, psk: Psk, remote_fingerprint: IdentityFingerprint, ) -> Result<(), RemoteClientError>

Pair with a remote device using a pre-shared key

This uses the PSK for authentication, skipping fingerprint verification since trust is established through the PSK.

Source

pub async fn load_cached_session( &mut self, remote_fingerprint: IdentityFingerprint, ) -> Result<(), RemoteClientError>

Reconnect to a remote device using a cached session

This verifies the session exists in the session store and reconnects without requiring fingerprint verification.

Source

pub async fn request_credential( &mut self, query: &CredentialQuery, ) -> Result<CredentialData, RemoteClientError>

Request a credential over the secure channel

Source

pub fn is_ready(&self) -> bool

Check if the secure channel is established

Source

pub async fn close(&mut self)

Close the connection

Source

pub fn session_store(&self) -> &dyn SessionStore

Get the session store for management operations

Source

pub fn session_store_mut(&mut self) -> &mut dyn SessionStore

Get a mutable reference to the session store

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more