Struct stellar_client::endpoint::account::Offers [−][src]
pub struct Offers { /* fields omitted */ }Represents the offers for account endpoint on the stellar horizon server. The endpoint will return all the Offers that a specific account makes.
https://www.stellar.org/developers/horizon/reference/endpoints/offers-for-account.html
Example
use stellar_client::sync::Client; use stellar_client::endpoint::{account, trade, Order, Direction::Desc, Limit}; let client = Client::horizon_test().unwrap(); // Grab trades and associated base account to ensure an account with offers let trades = trade::All::default().with_order(Desc).with_limit(1); let trades = client.request(trades).unwrap(); let trade = &trades.records()[0]; let account_id = trade.base_account(); // Now we issue a request for that account's offers let endpoint = account::Offers::new(account_id); let offers = client.request(endpoint).unwrap(); assert!(offers.records().len() > 0);
Methods
impl Offers[src]
impl Offerspub fn new(account_id: &str) -> Self[src]
pub fn new(account_id: &str) -> SelfCreates a new account::Offers endpoint struct. Hand this to the client in order to request offers made by a specific account.
use stellar_client::endpoint::account; let offers = account::Offers::new("abc123");
Trait Implementations
impl Debug for Offers[src]
impl Debug for Offersfn 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 Offers[src]
impl Clone for Offersfn clone(&self) -> Offers[src]
fn clone(&self) -> OffersReturns 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 Offers[src]
impl Cursor for Offersfn with_cursor(self, cursor: &str) -> Offers[src]
fn with_cursor(self, cursor: &str) -> OffersSets 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 Offers[src]
impl Limit for Offersfn with_limit(self, limit: u32) -> Offers[src]
fn with_limit(self, limit: u32) -> OffersSets 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 Offers[src]
impl Order for Offersfn with_order(self, order: Direction) -> Offers[src]
fn with_order(self, order: Direction) -> OffersSets 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 Offers[src]
impl IntoRequest for Offerstype Response = Records<Offer>
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