pub struct TpuClient { /* private fields */ }Expand description
Client which sends transactions directly to the current leader’s TPU port over UDP. The client uses RPC to determine the current leader and fetch node contact info
Implementations§
Source§impl TpuClient
impl TpuClient
Sourcepub fn send_transaction(&self, transaction: &Transaction) -> bool
pub fn send_transaction(&self, transaction: &Transaction) -> bool
Serialize and send transaction to the current and upcoming leader TPUs according to fanout size
Sourcepub fn send_wire_transaction(&self, wire_transaction: &[u8]) -> bool
pub fn send_wire_transaction(&self, wire_transaction: &[u8]) -> bool
Send a wire transaction to the current and upcoming leader TPUs according to fanout size
Sourcepub fn new(
rpc_client: Arc<RpcClient>,
websocket_url: &str,
config: TpuClientConfig,
) -> Result<Self, TpuSenderError>
pub fn new( rpc_client: Arc<RpcClient>, websocket_url: &str, config: TpuClientConfig, ) -> Result<Self, TpuSenderError>
Create a new client that disconnects when dropped
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TpuClient
impl !RefUnwindSafe for TpuClient
impl Send for TpuClient
impl Sync for TpuClient
impl Unpin for TpuClient
impl !UnwindSafe for TpuClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more