pub struct ShredStreamClient { /* private fields */ }Expand description
High-level multi-source shred subscription client.
Implementations§
Source§impl ShredStreamClient
impl ShredStreamClient
Sourcepub async fn new(udp_bind: impl Into<String>) -> AnyResult<Self>
pub async fn new(udp_bind: impl Into<String>) -> AnyResult<Self>
Create a client bound to a raw UDP address, for example 0.0.0.0:8001.
pub async fn new_with_decode_mode( decode_mode: ShredDecodeMode, ) -> AnyResult<Self>
pub async fn new_jito_grpc(endpoint: impl Into<String>) -> AnyResult<Self>
pub async fn new_with_config(config: ShredStreamConfig) -> AnyResult<Self>
Sourcepub async fn subscribe(&self) -> AnyResult<Arc<ArrayQueue<DexEvent>>>
pub async fn subscribe(&self) -> AnyResult<Arc<ArrayQueue<DexEvent>>>
Subscribe to all supported DEX events and return a lock-free queue.
All supported decode modes feed the same parser:
source -> Entry -> VersionedTransaction -> DexEvent.
Sourcepub async fn subscribe_with_filter(
&self,
event_type_filter: Option<EventTypeFilter>,
) -> AnyResult<Arc<ArrayQueue<DexEvent>>>
pub async fn subscribe_with_filter( &self, event_type_filter: Option<EventTypeFilter>, ) -> AnyResult<Arc<ArrayQueue<DexEvent>>>
Subscribe to DEX events with parser-side event filtering.
Sourcepub async fn subscribe_callback<F>(&self, callback: F) -> AnyResult<()>
pub async fn subscribe_callback<F>(&self, callback: F) -> AnyResult<()>
Lowest-latency built-in DEX path: event callback runs in the source receive task.
Sourcepub async fn subscribe_with_filter_callback<F>(
&self,
event_type_filter: Option<EventTypeFilter>,
callback: F,
) -> AnyResult<()>
pub async fn subscribe_with_filter_callback<F>( &self, event_type_filter: Option<EventTypeFilter>, callback: F, ) -> AnyResult<()>
Lowest-latency built-in DEX path with event filtering.
Sourcepub async fn subscribe_pumpfun(
&self,
parser_config: PumpfunParserConfig,
) -> AnyResult<Arc<ArrayQueue<PumpfunEvent>>>
pub async fn subscribe_pumpfun( &self, parser_config: PumpfunParserConfig, ) -> AnyResult<Arc<ArrayQueue<PumpfunEvent>>>
Compatibility convenience for the legacy PumpFun/Bonk parser.
Sourcepub async fn subscribe_pumpfun_callback<F>(
&self,
parser_config: PumpfunParserConfig,
callback: F,
) -> AnyResult<()>
pub async fn subscribe_pumpfun_callback<F>( &self, parser_config: PumpfunParserConfig, callback: F, ) -> AnyResult<()>
Lowest-latency built-in PumpFun/Bonk path: event callback runs in the source receive task.
Sourcepub async fn subscribe_with_parser<P>(
&self,
parser: P,
) -> AnyResult<Arc<ArrayQueue<P::Event>>>
pub async fn subscribe_with_parser<P>( &self, parser: P, ) -> AnyResult<Arc<ArrayQueue<P::Event>>>
Subscribe with a custom parser and return a queue of parser events.
Sourcepub async fn subscribe_with_parser_callback<P, F>(
&self,
parser: P,
callback: F,
) -> AnyResult<()>
pub async fn subscribe_with_parser_callback<P, F>( &self, parser: P, callback: F, ) -> AnyResult<()>
Subscribe with a custom parser and direct event callback.
pub async fn stop(&self)
Trait Implementations§
Source§impl Clone for ShredStreamClient
impl Clone for ShredStreamClient
Source§fn clone(&self) -> ShredStreamClient
fn clone(&self) -> ShredStreamClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ShredStreamClient
impl !UnwindSafe for ShredStreamClient
impl Freeze for ShredStreamClient
impl Send for ShredStreamClient
impl Sync for ShredStreamClient
impl Unpin for ShredStreamClient
impl UnsafeUnpin for ShredStreamClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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>
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request