Skip to main content

Session

Trait Session 

Source
pub(crate) trait Session: Sync {
    // Required methods
    fn token(&self) -> impl Future<Output = Option<String>> + Send;
    fn record(
        &self,
        snapshot: &FleetSnapshot,
        v: u32,
        published_at_ms: u64,
    ) -> Result<InstallPresence, String>;
    fn off(&self) -> Option<PresenceOffReason>;
}
Expand description

What a try needs besides the relay: the sign-in, the signed record, and whether to publish at all.

Required Methods§

Source

fn token(&self) -> impl Future<Output = Option<String>> + Send

The MuxBus access token; None when not signed in.

Source

fn record( &self, snapshot: &FleetSnapshot, v: u32, published_at_ms: u64, ) -> Result<InstallPresence, String>

The signed record for snapshot, or why there is none.

Source

fn off(&self) -> Option<PresenceOffReason>

Why this install doesn’t publish now; None when it does.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§