Skip to main content

ClientTransport

Trait ClientTransport 

Source
pub trait ClientTransport: Send {
Show 13 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 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 { ... }
}

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 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.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§