pub struct HttpTransportServer { /* private fields */ }Expand description
HTTP transport server implementation
Implementations§
Source§impl HttpTransportServer
impl HttpTransportServer
pub fn new(config: HttpTransportConfig) -> HttpTransportServer
pub fn with_metrics(self, metrics: Arc<MetricsCollector>) -> HttpTransportServer
pub fn with_monitoring( self, monitoring: Arc<MonitoringSystem>, ) -> HttpTransportServer
pub fn get_message_receiver(&self) -> Receiver<(String, JsonRpcMessage)>
pub fn get_message_sender(&self) -> Sender<(String, JsonRpcMessage)>
pub fn get_response_sender(&self) -> Sender<(String, JsonRpcMessage)>
pub fn get_state(&self) -> HttpTransportState
pub fn get_metrics(&self) -> Option<Arc<MetricsCollector>>
pub fn get_monitoring(&self) -> Option<Arc<MonitoringSystem>>
pub async fn run(self) -> Result<(), TransportError>
Trait Implementations§
Source§impl Transport for HttpTransportServer
impl Transport for HttpTransportServer
Source§fn send_message<'life0, 'async_trait>(
&'life0 mut self,
message: JsonRpcMessage,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
HttpTransportServer: 'async_trait,
fn send_message<'life0, 'async_trait>(
&'life0 mut self,
message: JsonRpcMessage,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
HttpTransportServer: 'async_trait,
Send a message through the transport
Source§fn receive_message<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<JsonRpcMessage, TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
HttpTransportServer: 'async_trait,
fn receive_message<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<JsonRpcMessage, TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
HttpTransportServer: 'async_trait,
Receive a message from the transport
Source§fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
HttpTransportServer: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
HttpTransportServer: 'async_trait,
Close the transport connection gracefully
Source§fn get_state(&self) -> ConnectionState
fn get_state(&self) -> ConnectionState
Get current connection state
Source§fn get_health(&self) -> TransportHealth
fn get_health(&self) -> TransportHealth
Get transport health information
Source§fn shutdown<'life0, 'async_trait>(
&'life0 mut self,
config: ShutdownConfig,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn shutdown<'life0, 'async_trait>(
&'life0 mut self,
config: ShutdownConfig,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Initiate graceful shutdown
Source§fn force_shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
fn force_shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
Self: 'async_trait,
Force immediate shutdown
Auto Trait Implementations§
impl Freeze for HttpTransportServer
impl !RefUnwindSafe for HttpTransportServer
impl Send for HttpTransportServer
impl Sync for HttpTransportServer
impl Unpin for HttpTransportServer
impl !UnwindSafe for HttpTransportServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more