pub struct AttachedBackend { /* private fields */ }Implementations§
Source§impl AttachedBackend
impl AttachedBackend
Sourcepub fn new(kind: BackendKind, base: &str, token: &str) -> Result<Self>
pub fn new(kind: BackendKind, base: &str, token: &str) -> Result<Self>
base is the server’s origin. The spec prefix and sliding sync are asked of the server.
Sourcepub fn with_prefix(
kind: BackendKind,
base: &str,
token: &str,
keep_prefix: bool,
) -> Result<Self>
pub fn with_prefix( kind: BackendKind, base: &str, token: &str, keep_prefix: bool, ) -> Result<Self>
No network at all: keep_prefix says whether the server serves the paths under /_matrix,
and sliding sync stays off.
Sourcepub fn without_sliding_sync(self) -> Self
pub fn without_sliding_sync(self) -> Self
Plain /sync v3 only.
pub fn uses_sliding_sync(&self) -> bool
Trait Implementations§
Source§impl Backend for AttachedBackend
impl Backend for AttachedBackend
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,
_: &IdentityStore,
_: &mut SessionIdentity,
_: Option<&str>,
) -> Result<Session>
fn ensure_session( &self, _: &IdentityStore, _: &mut SessionIdentity, _: 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 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 AttachedBackend
impl RefUnwindSafe for AttachedBackend
impl Send for AttachedBackend
impl Sync for AttachedBackend
impl Unpin for AttachedBackend
impl UnsafeUnpin for AttachedBackend
impl UnwindSafe for AttachedBackend
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