pub struct Client { /* private fields */ }Expand description
Client for Trading API
This API allow to interact with the trading system.
Version: 1.0.0
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(baseurl: &str) -> Self
pub fn new(baseurl: &str) -> Self
Create a new client.
baseurl is the base URL provided to the internal
reqwest::Client, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Sourcepub fn new_with_client(baseurl: &str, client: Client) -> Self
pub fn new_with_client(baseurl: &str, client: Client) -> Self
Construct a new client with an existing reqwest::Client,
allowing more control over its configuration.
baseurl is the base URL provided to the internal
reqwest::Client, and should include a scheme and hostname,
as well as port and a path stem if applicable.
Sourcepub fn api_version(&self) -> &'static str
pub fn api_version(&self) -> &'static str
Get the version of this API.
This string is pulled directly from the source OpenAPI document and may be in any format the API selects.
Source§impl Client
impl Client
Sourcepub async fn get_candles<'a>(
&'a self,
from: Option<i64>,
resolution: Resolution,
symbol: SymbolTicker,
to: Option<i64>,
) -> Result<ResponseValue<Candles>, Error<HkError>>
pub async fn get_candles<'a>( &'a self, from: Option<i64>, resolution: Resolution, symbol: SymbolTicker, to: Option<i64>, ) -> Result<ResponseValue<Candles>, Error<HkError>>
Get the list of candles
Sends a GET request to /candles
Arguments:
from: The start UNIX timestampresolution: The resolution of the candlessymbol: The symbol of the instrumentto: The end UNIX timestamp
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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