Struct longbridge_wscli::WsClient
source · [−]pub struct WsClient { /* private fields */ }
Expand description
Longbridge Websocket client
Implementations
sourceimpl WsClient
impl WsClient
sourcepub async fn open(
request: impl IntoClientRequest,
version: ProtocolVersion,
codec: CodecType,
platform: Platform,
event_sender: UnboundedSender<WsEvent>
) -> WsClientResult<Self>
pub async fn open(
request: impl IntoClientRequest,
version: ProtocolVersion,
codec: CodecType,
platform: Platform,
event_sender: UnboundedSender<WsEvent>
) -> WsClientResult<Self>
Connect to url
and returns a WsClient
object
sourcepub async fn request_auth(
&self,
otp: impl Into<String>
) -> WsClientResult<WsSession>
pub async fn request_auth(
&self,
otp: impl Into<String>
) -> WsClientResult<WsSession>
Send an authentication request to get a WsSession
Reference: https://open.longbridgeapp.com/en/docs/socket-token-api Reference: https://open.longbridgeapp.com/en/docs/socket/control-command#auth
sourcepub async fn request_reconnect(
&self,
session_id: impl Into<String>
) -> WsClientResult<WsSession>
pub async fn request_reconnect(
&self,
session_id: impl Into<String>
) -> WsClientResult<WsSession>
Send a reconnect request to get a WsSession
Reference: https://open.longbridgeapp.com/en/docs/socket/control-command#reconnect
sourcepub async fn request_raw(
&self,
command_code: u8,
timeout: Option<Duration>,
body: Vec<u8>
) -> WsClientResult<Vec<u8>>
pub async fn request_raw(
&self,
command_code: u8,
timeout: Option<Duration>,
body: Vec<u8>
) -> WsClientResult<Vec<u8>>
Send a raw request
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for WsClient
impl Send for WsClient
impl Sync for WsClient
impl Unpin for WsClient
impl !UnwindSafe for WsClient
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more