pub struct GRPCStream { /* private fields */ }Expand description
gRPC stream client for Hyperliquid real-time data
Implementations§
Source§impl GRPCStream
impl GRPCStream
Sourcepub fn configure(self, config: GRPCStreamConfig) -> Self
pub fn configure(self, config: GRPCStreamConfig) -> Self
Configure stream options
Sourcepub fn on_connect<F>(self, f: F) -> Self
pub fn on_connect<F>(self, f: F) -> Self
Set connect callback
Sourcepub fn on_reconnect<F>(self, f: F) -> Self
pub fn on_reconnect<F>(self, f: F) -> Self
Set reconnect callback
Sourcepub fn on_state_change<F>(self, f: F) -> Self
pub fn on_state_change<F>(self, f: F) -> Self
Set state change callback
Sourcepub fn state(&self) -> ConnectionState
pub fn state(&self) -> ConnectionState
Get current connection state
Sourcepub fn trades<F>(&mut self, coins: &[&str], callback: F) -> GRPCSubscription
pub fn trades<F>(&mut self, coins: &[&str], callback: F) -> GRPCSubscription
Subscribe to trades
Sourcepub fn orders<F>(&mut self, coins: &[&str], callback: F) -> GRPCSubscription
pub fn orders<F>(&mut self, coins: &[&str], callback: F) -> GRPCSubscription
Subscribe to orders
Sourcepub fn book_updates<F>(
&mut self,
coins: &[&str],
callback: F,
) -> GRPCSubscription
pub fn book_updates<F>( &mut self, coins: &[&str], callback: F, ) -> GRPCSubscription
Subscribe to book updates
Sourcepub fn l2_book<F>(&mut self, coin: &str, callback: F) -> GRPCSubscription
pub fn l2_book<F>(&mut self, coin: &str, callback: F) -> GRPCSubscription
Subscribe to L2 order book
Sourcepub fn l2_book_with_options<F>(
&mut self,
coin: &str,
n_levels: u32,
n_sig_figs: Option<u32>,
callback: F,
) -> GRPCSubscription
pub fn l2_book_with_options<F>( &mut self, coin: &str, n_levels: u32, n_sig_figs: Option<u32>, callback: F, ) -> GRPCSubscription
Subscribe to L2 order book with options
Sourcepub fn l4_book<F>(&mut self, coin: &str, callback: F) -> GRPCSubscription
pub fn l4_book<F>(&mut self, coin: &str, callback: F) -> GRPCSubscription
Subscribe to L4 order book (individual orders with OIDs)
Sourcepub fn blocks<F>(&mut self, callback: F) -> GRPCSubscription
pub fn blocks<F>(&mut self, callback: F) -> GRPCSubscription
Subscribe to blocks
Sourcepub fn twap<F>(&mut self, coins: &[&str], callback: F) -> GRPCSubscription
pub fn twap<F>(&mut self, coins: &[&str], callback: F) -> GRPCSubscription
Subscribe to TWAP updates
Sourcepub fn events<F>(&mut self, callback: F) -> GRPCSubscription
pub fn events<F>(&mut self, callback: F) -> GRPCSubscription
Subscribe to events
Sourcepub fn writer_actions<F>(&mut self, callback: F) -> GRPCSubscription
pub fn writer_actions<F>(&mut self, callback: F) -> GRPCSubscription
Subscribe to writer actions
Sourcepub fn unsubscribe(&mut self, subscription: &GRPCSubscription)
pub fn unsubscribe(&mut self, subscription: &GRPCSubscription)
Unsubscribe
Auto Trait Implementations§
impl Freeze for GRPCStream
impl !RefUnwindSafe for GRPCStream
impl Send for GRPCStream
impl Sync for GRPCStream
impl Unpin for GRPCStream
impl UnsafeUnpin for GRPCStream
impl !UnwindSafe for GRPCStream
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 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>
Wrap the input message
T in a tonic::Request