pub struct L2Client { /* private fields */ }Expand description
L2 book client for a single symbol. No retries/reconnection logic; it just subscribes to and maintains the book.
To use this, call L2Client::connect to construct a client, drive its
next method to apply updates, and use the accessors on L2Client to access
the current state of the book.
If you need multiple readers/consumers of this client, use L2Client::handle()
to create a cheaply cloneable handle to pass around.
Implementations§
Source§impl L2Client
impl L2Client
pub async fn new( channel: Channel, symbol: String, venue: Option<MarketdataVenue>, ) -> Result<Self>
pub async fn connect<D>( endpoint: D, symbol: String, venue: Option<MarketdataVenue>, ) -> Result<Self>
pub async fn next(&mut self) -> Option<SequenceIdAndNumber>
pub fn handle(&self) -> L2ClientHandle
pub fn sequence(&self) -> SequenceIdAndNumber
pub fn book(&self) -> MappedMutexGuard<'_, LevelBook>
Auto Trait Implementations§
impl !Freeze for L2Client
impl !RefUnwindSafe for L2Client
impl Send for L2Client
impl !Sync for L2Client
impl Unpin for L2Client
impl !UnwindSafe for L2Client
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