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§
fn session_id(&self) -> &SessionId
fn meta(&self) -> &SessionMeta
Sourcefn 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<'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).
Sourcefn 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 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).
Sourcefn 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 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.
Sourcefn view(&self) -> Arc<RuntimeView> ⓘ
fn view(&self) -> Arc<RuntimeView> ⓘ
Sync, cheap, never stale by more than one SettingChanged: what the
TUI’s getters read on day 2.
Sourcefn mode(&self) -> AttachMode
fn mode(&self) -> AttachMode
The mode this transport attached with.
Sourcefn input_owner(&self) -> Option<ClientId>
fn input_owner(&self) -> Option<ClientId>
Current input owner — updated from Attached / InputOwnerChanged.
Sourcefn 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,
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§
Sourcefn roster(&self) -> Roster
fn roster(&self) -> Roster
Attached clients, named — updated from Attached / ClientJoined /
ClientLeft. Empty for a transport that doesn’t track them.
Sourcefn client_input(&self) -> ClientInput
fn client_input(&self) -> ClientInput
Who may drive (from the attach snapshot). Exclusive for a
transport that doesn’t know.
Sourcefn 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 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.
Sourcefn is_reload_pending(&self) -> bool
fn is_reload_pending(&self) -> bool
true if the daemon announced a reload before EOF (graceful). Always
false on LocalTransport.
Sourcefn daemon_pid(&self) -> u32
fn daemon_pid(&self) -> u32
The daemon pid from Welcome. Returns 0 on LocalTransport.
Sourcefn daemon_binary(&self) -> Option<BinaryId>
fn daemon_binary(&self) -> Option<BinaryId>
The daemon’s binary from the latest Welcome (it changes across
daemon reload). None on LocalTransport: same binary.
Sourcefn socket_path(&self) -> Option<&Path>
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".