Skip to main content

E2eTransport

Trait E2eTransport 

Source
pub trait E2eTransport:
    Clone
    + Send
    + Sync
    + 'static {
    // Required methods
    fn invoke<R>(
        &self,
        req: &R,
    ) -> impl Future<Output = Result<R::Return, E2eError>> + Send
       where R: RemoteCall + Send + Sync;
    fn invoke_on_dc<R>(
        &self,
        dc_id: i32,
        req: &R,
    ) -> impl Future<Output = Result<R::Return, E2eError>> + Send
       where R: RemoteCall + Send + Sync;
}
Expand description

Minimal RPC surface the secret chat layer needs from a Telegram client.

Implementations must be cheap to clone (typically a handle around an Arc). Failures are reported as E2eError::Transport.

Required Methods§

Source

fn invoke<R>( &self, req: &R, ) -> impl Future<Output = Result<R::Return, E2eError>> + Send
where R: RemoteCall + Send + Sync,

Invoke req on the client’s home DC.

Source

fn invoke_on_dc<R>( &self, dc_id: i32, req: &R, ) -> impl Future<Output = Result<R::Return, E2eError>> + Send
where R: RemoteCall + Send + Sync,

Invoke req on the datacenter dc_id.

Secret chat files live on the DC named in EncryptedFile::dc_id, which is not necessarily the home DC.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§