solana_connection_cache/nonblocking/
client_connection.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Trait defining async send functions, to be used for UDP or QUIC sending

use {
    async_trait::async_trait, solana_sdk::transport::Result as TransportResult,
    std::net::SocketAddr,
};

#[async_trait]
pub trait ClientConnection {
    fn server_addr(&self) -> &SocketAddr;

    async fn send_data(&self, buffer: &[u8]) -> TransportResult<()>;

    async fn send_data_batch(&self, buffers: &[Vec<u8>]) -> TransportResult<()>;
}