pub struct WsClient { /* private fields */ }Expand description
Low-level WebSocket transport.
Self::send_hello deliberately retains no handshake state. Callers using
this raw client must wait for Welcome and validate it with
Check the Welcome protocol version before sending authentication or
exposing the frame to application code. crate::ws::managed and the
vault fleet enforce that sequence themselves.
Implementations§
Source§impl WsClient
impl WsClient
pub async fn connect(url: &str) -> WsResult<Self>
pub async fn connect_with_config( url: &str, config: WsTransportConfig, ) -> WsResult<Self>
pub async fn send(&mut self, msg: &ClientMessage) -> WsResult<()>
pub async fn send_prepared( &mut self, message: &PreparedClientMessage, ) -> WsResult<()>
Sourcepub async fn send_prepared_owned(
&mut self,
message: PreparedClientMessage,
) -> WsResult<()>
pub async fn send_prepared_owned( &mut self, message: PreparedClientMessage, ) -> WsResult<()>
Send a prepared message by transferring its buffer into the socket sink.
pub async fn send_hello(&mut self, data: HelloData) -> WsResult<()>
pub async fn resume_auth(&mut self, data: ResumeAuthData) -> WsResult<()>
pub async fn auth_challenge(&mut self, data: AuthChallengeData) -> WsResult<()>
pub async fn quote(&mut self, data: QuoteMessage) -> WsResult<()>
pub async fn replace_quote(&mut self, data: ReplaceQuoteMessage) -> WsResult<()>
pub async fn batch_quotes(&mut self, data: BatchQuotesMessage) -> WsResult<()>
pub async fn subscribe(&mut self, data: SubscribeData) -> WsResult<()>
pub async fn unsubscribe(&mut self, data: UnsubscribeData) -> WsResult<()>
pub async fn get_my_quotes(&mut self, data: GetMyQuotesMessage) -> WsResult<()>
pub async fn get_maker_positions( &mut self, data: GetMakerPositionsMessage, ) -> WsResult<()>
pub async fn get_markets_for_maker( &mut self, data: GetMarketsForMakerMessage, ) -> WsResult<()>
pub async fn rfq_request(&mut self, data: RfqRequestMessage) -> WsResult<()>
pub async fn accept_quote(&mut self, data: AcceptQuoteMessage) -> WsResult<()>
pub async fn submit_signed_sponsored_tx( &mut self, data: SubmitSignedSponsoredTxData, ) -> WsResult<()>
pub async fn indicative_prices_response( &mut self, data: IndicativePricesResponseMessage, ) -> WsResult<()>
pub async fn get_indicative_prices( &mut self, data: GetIndicativePricesMessage, ) -> WsResult<()>
pub async fn get_market_descriptors( &mut self, data: GetMarketDescriptorsMessage, ) -> WsResult<()>
pub async fn get_tokens(&mut self, data: GetTokensMessage) -> WsResult<()>
pub async fn get_expiries(&mut self, data: GetExpiriesMessage) -> WsResult<()>
pub async fn get_order_status( &mut self, data: GetOrderStatusMessage, ) -> WsResult<()>
pub async fn redeem_invite(&mut self, data: RedeemInviteData) -> WsResult<()>
pub async fn claim_referral_code( &mut self, data: ClaimReferralCodeData, ) -> WsResult<()>
pub async fn get_my_referral_info( &mut self, data: GetMyReferralInfoData, ) -> WsResult<()>
pub async fn get_mm_summary( &mut self, data: GetMmSummaryMessage, ) -> WsResult<()>
pub async fn get_position_summary( &mut self, data: GetPositionSummaryMessage, ) -> WsResult<()>
pub async fn get_subscriptions(&mut self) -> WsResult<()>
pub async fn get_markets(&mut self) -> WsResult<()>
pub async fn get_positions(&mut self, data: GetPositionsMessage) -> WsResult<()>
pub async fn get_my_active_rfqs( &mut self, data: GetMyActiveRfqsMessage, ) -> WsResult<()>
pub async fn get_active_rfqs( &mut self, data: GetActiveRfqsMessage, ) -> WsResult<()>
pub async fn ping(&mut self) -> WsResult<()>
pub async fn logout(&mut self) -> WsResult<()>
pub async fn start_auth(&mut self, pubkey: Address32) -> WsResult<()>
pub async fn cancel_quote(&mut self, rfq_id: Uuid) -> WsResult<()>
pub async fn cancel_all_quotes( &mut self, market: QueryFilter<Address32>, ) -> WsResult<()>
pub async fn cancel_rfq(&mut self, rfq_id: Uuid) -> WsResult<()>
pub async fn add_mints( &mut self, underlying_mints: Vec<Address32>, quote_mints: Vec<Address32>, ) -> WsResult<()>
pub async fn remove_mints( &mut self, underlying_mints: Vec<Address32>, quote_mints: Vec<Address32>, ) -> WsResult<()>
pub async fn add_channels(&mut self, channels: Vec<WsChannel>) -> WsResult<()>
pub async fn remove_channels( &mut self, channels: Vec<WsChannel>, ) -> WsResult<()>
pub async fn send_text(&mut self, text: impl Into<String>) -> WsResult<()>
Sourcepub fn server_close(&self) -> Option<&ServerClose>
pub fn server_close(&self) -> Option<&ServerClose>
The server’s close frame once Self::next has returned None after one.
pub async fn next(&mut self) -> Option<Result<ServerMessage, WsClientError>>
pub async fn close(self) -> WsResult<()>
Auto Trait Implementations§
impl !Freeze for WsClient
impl !RefUnwindSafe for WsClient
impl !UnwindSafe for WsClient
impl Forget for WsClient
impl Send for WsClient
impl Sync for WsClient
impl Unpin for WsClient
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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