pub struct MatrixBackend { /* private fields */ }Implementations§
Source§impl MatrixBackend
impl MatrixBackend
Sourcepub fn discover(origin: &str) -> Result<Self>
pub fn discover(origin: &str) -> Result<Self>
Asks the domain’s .well-known for the real server address first, then connects there.
pub fn with_wire(base_url: &str, wire: Box<dyn Wire>) -> Result<Self>
pub fn with_sync_mode(self, mode: SyncMode) -> Self
Sourcepub fn uses_sliding_sync(&self) -> bool
pub fn uses_sliding_sync(&self) -> bool
Whether /sync calls are currently served by sliding sync (after the first sync decided).
Trait Implementations§
Source§impl Backend for MatrixBackend
impl Backend for MatrixBackend
fn kind(&self) -> BackendKind
fn capabilities(&self) -> Capabilities
Source§fn server_ref(&self) -> &str
fn server_ref(&self) -> &str
The normalized server base URL this backend talks to (the identity is bound to it).
Source§fn ensure_session(
&self,
ids: &IdentityStore,
id: &mut SessionIdentity,
invite: Option<&str>,
) -> Result<Session>
fn ensure_session( &self, ids: &IdentityStore, id: &mut SessionIdentity, invite: Option<&str>, ) -> Result<Session>
A live session for
id. First time: redeems the operator’s invite (enroll the public key,
proving possession of the private one); afterwards: logs in by signing a fresh challenge.
Reuses the stored token while the server still accepts it. Persists what it learns.Source§fn execute(&self, request: &OutgoingRequest) -> Result<HttpResponseDescriptor>
fn execute(&self, request: &OutgoingRequest) -> Result<HttpResponseDescriptor>
Performs one request of the engine as this session (bearer added, token refreshed once by
signature if the server forgot it). Callable from any thread. Needs
ensure_session first.Source§fn wait_for_news(&self, timeout: Duration) -> Result<News>
fn wait_for_news(&self, timeout: Duration) -> Result<News>
Waits up to
timeout for news for this session: room events pushed on the server’s push
socket, or Idle (timeout, or the server has no push channel and the sync long poll is the
wait).Source§fn whoami(&self) -> Result<(String, String)>
fn whoami(&self) -> Result<(String, String)>
(user_id, device_id) of the session (what the engine needs to open a core).Source§fn keep_prefix(&self) -> bool
fn keep_prefix(&self) -> bool
Whether this server serves the Matrix paths under
/_matrix (found out, not assumed).Auto Trait Implementations§
impl !Freeze for MatrixBackend
impl !RefUnwindSafe for MatrixBackend
impl !UnwindSafe for MatrixBackend
impl Send for MatrixBackend
impl Sync for MatrixBackend
impl Unpin for MatrixBackend
impl UnsafeUnpin for MatrixBackend
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