Skip to main content

WsClient

Struct WsClient 

Source
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

Source

pub async fn connect(url: &str) -> WsResult<Self>

Source

pub async fn connect_with_config( url: &str, config: WsTransportConfig, ) -> WsResult<Self>

Source

pub async fn send(&mut self, msg: &ClientMessage) -> WsResult<()>

Source

pub async fn send_prepared( &mut self, message: &PreparedClientMessage, ) -> WsResult<()>

Source

pub async fn send_prepared_owned( &mut self, message: PreparedClientMessage, ) -> WsResult<()>

Send a prepared message by transferring its buffer into the socket sink.

Source

pub async fn send_hello(&mut self, data: HelloData) -> WsResult<()>

Source

pub async fn resume_auth(&mut self, data: ResumeAuthData) -> WsResult<()>

Source

pub async fn auth_challenge(&mut self, data: AuthChallengeData) -> WsResult<()>

Source

pub async fn quote(&mut self, data: QuoteMessage) -> WsResult<()>

Source

pub async fn replace_quote(&mut self, data: ReplaceQuoteMessage) -> WsResult<()>

Source

pub async fn batch_quotes(&mut self, data: BatchQuotesMessage) -> WsResult<()>

Source

pub async fn subscribe(&mut self, data: SubscribeData) -> WsResult<()>

Source

pub async fn unsubscribe(&mut self, data: UnsubscribeData) -> WsResult<()>

Source

pub async fn get_my_quotes(&mut self, data: GetMyQuotesMessage) -> WsResult<()>

Source

pub async fn get_maker_positions( &mut self, data: GetMakerPositionsMessage, ) -> WsResult<()>

Source

pub async fn get_markets_for_maker( &mut self, data: GetMarketsForMakerMessage, ) -> WsResult<()>

Source

pub async fn rfq_request(&mut self, data: RfqRequestMessage) -> WsResult<()>

Source

pub async fn accept_quote(&mut self, data: AcceptQuoteMessage) -> WsResult<()>

Source

pub async fn submit_signed_sponsored_tx( &mut self, data: SubmitSignedSponsoredTxData, ) -> WsResult<()>

Source

pub async fn indicative_prices_response( &mut self, data: IndicativePricesResponseMessage, ) -> WsResult<()>

Source

pub async fn get_indicative_prices( &mut self, data: GetIndicativePricesMessage, ) -> WsResult<()>

Source

pub async fn get_market_descriptors( &mut self, data: GetMarketDescriptorsMessage, ) -> WsResult<()>

Source

pub async fn get_tokens(&mut self, data: GetTokensMessage) -> WsResult<()>

Source

pub async fn get_expiries(&mut self, data: GetExpiriesMessage) -> WsResult<()>

Source

pub async fn get_order_status( &mut self, data: GetOrderStatusMessage, ) -> WsResult<()>

Source

pub async fn redeem_invite(&mut self, data: RedeemInviteData) -> WsResult<()>

Source

pub async fn claim_referral_code( &mut self, data: ClaimReferralCodeData, ) -> WsResult<()>

Source

pub async fn get_my_referral_info( &mut self, data: GetMyReferralInfoData, ) -> WsResult<()>

Source

pub async fn get_mm_summary( &mut self, data: GetMmSummaryMessage, ) -> WsResult<()>

Source

pub async fn get_position_summary( &mut self, data: GetPositionSummaryMessage, ) -> WsResult<()>

Source

pub async fn get_subscriptions(&mut self) -> WsResult<()>

Source

pub async fn get_markets(&mut self) -> WsResult<()>

Source

pub async fn get_positions(&mut self, data: GetPositionsMessage) -> WsResult<()>

Source

pub async fn get_my_active_rfqs( &mut self, data: GetMyActiveRfqsMessage, ) -> WsResult<()>

Source

pub async fn get_active_rfqs( &mut self, data: GetActiveRfqsMessage, ) -> WsResult<()>

Source

pub async fn ping(&mut self) -> WsResult<()>

Source

pub async fn logout(&mut self) -> WsResult<()>

Source

pub async fn start_auth(&mut self, pubkey: Address32) -> WsResult<()>

Source

pub async fn cancel_quote(&mut self, rfq_id: Uuid) -> WsResult<()>

Source

pub async fn cancel_all_quotes( &mut self, market: QueryFilter<Address32>, ) -> WsResult<()>

Source

pub async fn cancel_rfq(&mut self, rfq_id: Uuid) -> WsResult<()>

Source

pub async fn add_mints( &mut self, underlying_mints: Vec<Address32>, quote_mints: Vec<Address32>, ) -> WsResult<()>

Source

pub async fn remove_mints( &mut self, underlying_mints: Vec<Address32>, quote_mints: Vec<Address32>, ) -> WsResult<()>

Source

pub async fn add_channels(&mut self, channels: Vec<WsChannel>) -> WsResult<()>

Source

pub async fn remove_channels( &mut self, channels: Vec<WsChannel>, ) -> WsResult<()>

Source

pub async fn send_text(&mut self, text: impl Into<String>) -> WsResult<()>

Source

pub fn server_close(&self) -> Option<&ServerClose>

The server’s close frame once Self::next has returned None after one.

Source

pub async fn next(&mut self) -> Option<Result<ServerMessage, WsClientError>>

Source

pub async fn close(self) -> WsResult<()>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more