Trait jsonrpsee_core::client::TransportSenderT
source · pub trait TransportSenderT: MaybeSend + 'static {
type Error: Error + Send + Sync;
fn send<'life0, 'async_trait>(
&'life0 mut self,
msg: String
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
fn send_ping<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where
Self: Send + 'async_trait,
'life0: 'async_trait,
{ ... }
fn close<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where
Self: Send + 'async_trait,
'life0: 'async_trait,
{ ... }
}
Expand description
Transport interface to send data asynchronous.
Required Associated Types§
Required Methods§
Provided Methods§
sourcefn send_ping<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn send_ping<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
This is optional because it’s most likely relevant for WebSocket transports only. You should only implement this is your transport supports sending periodic pings.
Send ping frame (opcode of 0x9).
sourcefn close<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn close<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
This is optional because it’s most likely relevant for WebSocket transports only. You should only implement this is your transport supports being closed.
Send customized close message.