pub trait TransportStrategy: Send + Sync {
// Required methods
fn Connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn Disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn SendRequest<'life0, 'async_trait>(
&'life0 mut self,
Request: UnifiedRequest,
) -> Pin<Box<dyn Future<Output = Result<UnifiedResponse, TransportError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn SendNotification<'life0, 'async_trait>(
&'life0 mut self,
Notification: UnifiedRequest,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn StreamEvents(
&self,
) -> Result<BoxStream<'static, UnifiedResponse>, TransportError>;
fn IsConnected(&self) -> bool;
fn LatencyMilliseconds(&self) -> u64;
fn TransportKind(&self) -> TransportType;
fn Configuration(&self) -> &TransportConfig;
fn SupportsStreaming(&self) -> bool;
fn Capabilities(&self) -> TransportCapabilities;
fn Metrics(&self) -> TransportMetrics;
}Expand description
Core transport strategy trait.
This trait defines the essential operations that any transport mechanism must provide. Components interact with transports through this trait, allowing them to be transport-agnostic.
Required Methods§
Sourcefn Connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn Connect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Establishes a connection to the transport endpoint.
Sourcefn Disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn Disconnect<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Closes the connection and releases any associated resources.
Sourcefn SendRequest<'life0, 'async_trait>(
&'life0 mut self,
Request: UnifiedRequest,
) -> Pin<Box<dyn Future<Output = Result<UnifiedResponse, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn SendRequest<'life0, 'async_trait>(
&'life0 mut self,
Request: UnifiedRequest,
) -> Pin<Box<dyn Future<Output = Result<UnifiedResponse, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a request and waits for a response.
Sourcefn SendNotification<'life0, 'async_trait>(
&'life0 mut self,
Notification: UnifiedRequest,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn SendNotification<'life0, 'async_trait>(
&'life0 mut self,
Notification: UnifiedRequest,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sends a notification (fire-and-forget message).
Sourcefn StreamEvents(
&self,
) -> Result<BoxStream<'static, UnifiedResponse>, TransportError>
fn StreamEvents( &self, ) -> Result<BoxStream<'static, UnifiedResponse>, TransportError>
Creates a stream of events from the transport.
Sourcefn IsConnected(&self) -> bool
fn IsConnected(&self) -> bool
Checks if the transport is currently connected.
Sourcefn LatencyMilliseconds(&self) -> u64
fn LatencyMilliseconds(&self) -> u64
Returns the estimated round-trip latency in milliseconds.
Sourcefn TransportKind(&self) -> TransportType
fn TransportKind(&self) -> TransportType
Returns the type of transport (gRPC, IPC, WASM, etc.).
Sourcefn Configuration(&self) -> &TransportConfig
fn Configuration(&self) -> &TransportConfig
Returns the transport’s configuration.
Sourcefn SupportsStreaming(&self) -> bool
fn SupportsStreaming(&self) -> bool
Checks if the transport supports bidirectional streaming.
Sourcefn Capabilities(&self) -> TransportCapabilities
fn Capabilities(&self) -> TransportCapabilities
Returns the transport’s current capabilities and limits.
Sourcefn Metrics(&self) -> TransportMetrics
fn Metrics(&self) -> TransportMetrics
Collects and returns current performance metrics.