Struct stellar_client::endpoint::ledger::Payments [−][src]
pub struct Payments { /* fields omitted */ }Represents the payments for ledger endpoint on the stellar horizon server. The endpoint will return all the payment for a single ledger in the chain.
https://www.stellar.org/developers/horizon/reference/endpoints/payments-for-ledger.html
Example
use stellar_client::sync::Client; use stellar_client::endpoint::{ledger, payment, transaction}; let client = Client::horizon_test().unwrap(); // Grab payments so that we know we are getting a ledger involving payments let payments = client.request(payment::All::default()).unwrap(); let payment = &payments.records()[0]; // Payment operations have a reference to the transaction let txn_hash = payment.transaction(); // The transaction details can then tell us the ledger that // the transaction was on let txn = client.request(transaction::Details::new(txn_hash)).unwrap(); let sequence = txn.ledger(); // Now we issue a request for that ledgers payments let endpoint = ledger::Payments::new(sequence); let payments = client.request(endpoint).unwrap(); assert!(payments.records().len() > 0);
Methods
impl Payments[src]
impl Paymentspub fn new(sequence: u32) -> Payments[src]
pub fn new(sequence: u32) -> PaymentsCreates a new payments endpoint struct.
use stellar_client::endpoint::ledger; let payments = ledger::Payments::new(123);
Trait Implementations
impl Debug for Payments[src]
impl Debug for Paymentsfn 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 Payments[src]
impl Clone for Paymentsfn clone(&self) -> Payments[src]
fn clone(&self) -> PaymentsReturns 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 Payments[src]
impl Cursor for Paymentsfn with_cursor(self, cursor: &str) -> Payments[src]
fn with_cursor(self, cursor: &str) -> PaymentsSets 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 Payments[src]
impl Limit for Paymentsfn with_limit(self, limit: u32) -> Payments[src]
fn with_limit(self, limit: u32) -> PaymentsSets 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 Payments[src]
impl Order for Paymentsfn with_order(self, order: Direction) -> Payments[src]
fn with_order(self, order: Direction) -> PaymentsSets 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 Payments[src]
impl IntoRequest for Paymentstype Response = Records<Operation>
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