pub struct BybitRaw { /* private fields */ }Expand description
A handle to the whole API with the quota of the connector it came from.
Implementations§
Source§impl BybitRaw
impl BybitRaw
Sourcepub async fn call<T, F, Fut>(&self, method: &str, f: F) -> Result<T, Error>
pub async fn call<T, F, Fut>(&self, method: &str, f: F) -> Result<T, Error>
Runs one read. The quota of method is taken first.
§Errors
[Error::RateLimited] when the quota is spent (nothing is sent), else the error of the call.
Sourcepub async fn call_command<T, F, Fut>(
&self,
method: &str,
f: F,
) -> Result<T, Error>
pub async fn call_command<T, F, Fut>( &self, method: &str, f: F, ) -> Result<T, Error>
Runs one command that changes the account. A lost answer is [Error::Unknown], and the call is never repeated.
§Errors
As BybitRaw::call, with the unknown outcome of a command.
Sourcepub fn connect_ws(
&self,
stream: WsStream,
event_tx: AsyncSender<WsIncoming>,
options: WsOptions,
) -> Result<WsSession, Error>
pub fn connect_ws( &self, stream: WsStream, event_tx: AsyncSender<WsIncoming>, options: WsOptions, ) -> Result<WsSession, Error>
Opens one more session of a stream with the same key. The frames arrive in event_tx.
§Errors
[Error::RateLimited] when the quota for connections is spent.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for BybitRaw
impl !UnwindSafe for BybitRaw
impl Freeze for BybitRaw
impl Send for BybitRaw
impl Sync for BybitRaw
impl Unpin for BybitRaw
impl UnsafeUnpin for BybitRaw
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