Skip to main content

ClientTransport

Trait ClientTransport 

Source
pub trait ClientTransport: Send {
Show 17 methods // Required methods fn session_id(&self) -> &SessionId; fn meta(&self) -> &SessionMeta; fn send<'life0, 'async_trait>( &'life0 self, cmd: SessionCommand, ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn send_from_self<'life0, 'async_trait>( &'life0 self, cmd: SessionCommand, ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn next_event<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Option<Envelope>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn view(&self) -> Arc<RuntimeView> ⓘ; fn client_id(&self) -> ClientId; fn mode(&self) -> AttachMode; fn input_owner(&self) -> Option<ClientId>; fn reconnect<'life0, 'async_trait>( &'life0 mut self, mode: AttachMode, ) -> Pin<Box<dyn Future<Output = Result<AttachSnapshot, TransportError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn roster(&self) -> Roster { ... } fn client_input(&self) -> ClientInput { ... } fn reconnect_once<'life0, 'async_trait>( &'life0 mut self, mode: AttachMode, ) -> Pin<Box<dyn Future<Output = Result<AttachSnapshot, TransportError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn is_reload_pending(&self) -> bool { ... } fn daemon_pid(&self) -> u32 { ... } fn daemon_binary(&self) -> Option<BinaryId> { ... } fn socket_path(&self) -> Option<&Path> { ... }
}

Required Methods§

Source

fn session_id(&self) -> &SessionId

Source

fn meta(&self) -> &SessionMeta

Source

fn send<'life0, 'async_trait>( &'life0 self, cmd: SessionCommand, ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Host-originated send (from: None; bypasses input ownership).

Source

fn send_from_self<'life0, 'async_trait>( &'life0 self, cmd: SessionCommand, ) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Send stamped with this client’s id (the TUI uses this; ownership is enforced by the actor, B1).

Source

fn next_event<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Option<Envelope>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Next envelope, or None when the session ended / socket closed.

Source

fn view(&self) -> Arc<RuntimeView> ⓘ

Sync, cheap, never stale by more than one SettingChanged: what the TUI’s getters read on day 2.

Source

fn client_id(&self) -> ClientId

Client id assigned at Attach (needed for Detach/Resync).

Source

fn mode(&self) -> AttachMode

The mode this transport attached with.

Source

fn input_owner(&self) -> Option<ClientId>

Current input owner — updated from Attached / InputOwnerChanged.

Source

fn reconnect<'life0, 'async_trait>( &'life0 mut self, mode: AttachMode, ) -> Pin<Box<dyn Future<Output = Result<AttachSnapshot, TransportError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Socket only (Local returns Err(Unsupported)): after Reloading/EOF, reconnect with backoff and re-attach with mode (C3/A4).

Provided Methods§

Source

fn roster(&self) -> Roster

Attached clients, named — updated from Attached / ClientJoined / ClientLeft. Empty for a transport that doesn’t track them.

Source

fn client_input(&self) -> ClientInput

Who may drive (from the attach snapshot). Exclusive for a transport that doesn’t know.

Source

fn reconnect_once<'life0, 'async_trait>( &'life0 mut self, mode: AttachMode, ) -> Pin<Box<dyn Future<Output = Result<AttachSnapshot, TransportError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

F9: single reconnect attempt (no retry loop). Socket only.

Source

fn is_reload_pending(&self) -> bool

true if the daemon announced a reload before EOF (graceful). Always false on LocalTransport.

Source

fn daemon_pid(&self) -> u32

The daemon pid from Welcome. Returns 0 on LocalTransport.

Source

fn daemon_binary(&self) -> Option<BinaryId>

The daemon’s binary from the latest Welcome (it changes across daemon reload). None on LocalTransport: same binary.

Source

fn socket_path(&self) -> Option<&Path>

The daemon control socket this transport talks to. None on LocalTransport (no daemon). Lets a client open its own control connections (session list, pin, close) to the same daemon.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§