Skip to main content

TransportStrategy

Trait TransportStrategy 

Source
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§

Source

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.

Source

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.

Source

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.

Source

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

Source

fn StreamEvents( &self, ) -> Result<BoxStream<'static, UnifiedResponse>, TransportError>

Creates a stream of events from the transport.

Source

fn IsConnected(&self) -> bool

Checks if the transport is currently connected.

Source

fn LatencyMilliseconds(&self) -> u64

Returns the estimated round-trip latency in milliseconds.

Source

fn TransportKind(&self) -> TransportType

Returns the type of transport (gRPC, IPC, WASM, etc.).

Source

fn Configuration(&self) -> &TransportConfig

Returns the transport’s configuration.

Source

fn SupportsStreaming(&self) -> bool

Checks if the transport supports bidirectional streaming.

Source

fn Capabilities(&self) -> TransportCapabilities

Returns the transport’s current capabilities and limits.

Source

fn Metrics(&self) -> TransportMetrics

Collects and returns current performance metrics.

Implementors§