Skip to main content

Bridge

Trait Bridge 

Source
pub trait Bridge: Send {
    // Required methods
    fn name(&self) -> &'static str;
    fn connect(&mut self, vault: &ScopedVault) -> Result<()>;
    fn outgoing(&mut self, remote_room: &str, ev: &LocalEvent) -> Result<()>;
    fn incoming(&mut self) -> Result<Vec<(String, String, String)>>;
}

Required Methods§

Source

fn name(&self) -> &'static str

Registry key and feature name (bridge-<name>).

Source

fn connect(&mut self, vault: &ScopedVault) -> Result<()>

Open the connection to the other messenger with credentials from vault.

Source

fn outgoing(&mut self, remote_room: &str, ev: &LocalEvent) -> Result<()>

A consented room’s event, to be sent on the other messenger. remote_room is the other side’s room the user linked.

Source

fn incoming(&mut self) -> Result<Vec<(String, String, String)>>

Messages that arrived on the other messenger for (remote_room); each is routed to the linked local room only if consent still holds.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§