pub struct WsClient { /* private fields */ }
Implementations§
Source§impl WsClient
impl WsClient
Sourcepub fn get_update_stream(&self) -> WsClientUpdateStream<'_>
pub fn get_update_stream(&self) -> WsClientUpdateStream<'_>
Retrieves a stream of WebSocket updates from the server.
§Returns
WsClientUpdateStream
- A stream of updates that can be polled asynchronously.
§Lifetime
The lifetime of the update stream is guaranteed at compile time to be tied to the WsClient
.
If the WsClient
is dropped, the stream will also become invalid.
Sourcepub async fn chain_subscribe(
&self,
chain_ids: Vec<String>,
) -> Result<(), ClientError>
pub async fn chain_subscribe( &self, chain_ids: Vec<String>, ) -> Result<(), ClientError>
Sourcepub async fn chain_unsubscribe(
&self,
chain_ids: Vec<String>,
) -> Result<(), ClientError>
pub async fn chain_unsubscribe( &self, chain_ids: Vec<String>, ) -> Result<(), ClientError>
Sourcepub async fn submit_bid(&self, bid: BidCreate) -> Result<BidResult, ClientError>
pub async fn submit_bid(&self, bid: BidCreate) -> Result<BidResult, ClientError>
Submits a bid to the server.
§Arguments
bid
- The bid object to be submitted, which contains the relevant parameters for the transaction.
§Returns
Result<api_types::bid::BidResult, ClientError>
- The result of the bid submission.
§Errors
Returns an error if the WebSocket request fails or the server responds with an error.
Sourcepub async fn cancel_bid(&self, bid_cancel: BidCancel) -> Result<(), ClientError>
pub async fn cancel_bid(&self, bid_cancel: BidCancel) -> Result<(), ClientError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WsClient
impl !RefUnwindSafe for WsClient
impl Send for WsClient
impl Sync for WsClient
impl Unpin for WsClient
impl !UnwindSafe for WsClient
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> 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> 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