solana_client/
client_option.rs

1use {
2    crate::connection_cache::ConnectionCache,
3    solana_keypair::Keypair,
4    std::{net::UdpSocket, sync::Arc},
5    tokio::runtime::Handle as RuntimeHandle,
6    tokio_util::sync::CancellationToken,
7};
8
9/// [`ClientOption`] enum represents the available client types for TPU
10/// communication:
11/// * [`ConnectionCacheClient`]: Uses a shared [`ConnectionCache`] to manage
12///   connections efficiently.
13/// * [`TpuClientNextClient`]: Relies on the `tpu-client-next` crate and
14///   requires a reference to a [`Keypair`].
15pub enum ClientOption<'a> {
16    ConnectionCache(Arc<ConnectionCache>),
17    TpuClientNext(&'a Keypair, UdpSocket, RuntimeHandle, CancellationToken),
18}