Struct stellar_client::endpoint::account::Trades [−][src]
pub struct Trades { /* fields omitted */ }Represents the trades for account endpoint on the stellar horizon server. The endpoint will return all the trades for a specific account
https://www.stellar.org/developers/horizon/reference/endpoints/trades-for-account.html
Example
use stellar_client::sync::Client; use stellar_client::endpoint::{account, trade, Limit}; let client = Client::horizon_test().unwrap(); // Grab trade and associated account to ensure an account populated with trades let trade_ep = trade::All::default().with_limit(1); let all_trades = client.request(trade_ep).unwrap(); let trade = &all_trades.records()[0]; let account_id = trade.selling_account(); // Now we issue a request for that account's trades let endpoint = account::Trades::new(account_id); let acct_trades = client.request(endpoint).unwrap(); assert!(acct_trades.records().len() > 0);
Methods
impl Trades[src]
impl Tradespub fn new(account_id: &str) -> Self[src]
pub fn new(account_id: &str) -> SelfCreates a new account::Trades endpoint struct. Hand this to the client in order to request trades for a specific account.
use stellar_client::endpoint::account; let trades = account::Trades::new("abc123");
Trait Implementations
impl Debug for Trades[src]
impl Debug for Tradesfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl Clone for Trades[src]
impl Clone for Tradesfn clone(&self) -> Trades[src]
fn clone(&self) -> TradesReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Cursor for Trades[src]
impl Cursor for Tradesfn with_cursor(self, cursor: &str) -> Trades[src]
fn with_cursor(self, cursor: &str) -> TradesSets a cursor on the struct and returns an owned version.
fn cursor(&self) -> Option<&str>[src]
fn cursor(&self) -> Option<&str>Returns the cursor that has been set, if it has been set.
impl Limit for Trades[src]
impl Limit for Tradesfn with_limit(self, limit: u32) -> Trades[src]
fn with_limit(self, limit: u32) -> TradesSets a limit on the struct and returns an owned version.
fn limit(&self) -> Option<u32>[src]
fn limit(&self) -> Option<u32>Returns the limit or None.
impl Order for Trades[src]
impl Order for Tradesfn with_order(self, order: Direction) -> Trades[src]
fn with_order(self, order: Direction) -> TradesSets the order on the struct and returns an owned version.
fn order(&self) -> Option<Direction>[src]
fn order(&self) -> Option<Direction>Returns the order that has been set, if it has been set.
impl IntoRequest for Trades[src]
impl IntoRequest for Tradestype Response = Records<Trade>
The deserializable type that is expected to come back from the stellar server.
fn into_request(self, host: &str) -> Result<Request<Body>>[src]
fn into_request(self, host: &str) -> Result<Request<Body>>The request body to be sent to stellar. Generally this is just a () unit. Converts the implementing struct into an http request. Read more