Struct stellar_client::client::sync::Client[][src]

pub struct Client { /* fields omitted */ }

A client that can issue requests to a horizon api in a synchronous fashion, meaning that the functions will block until the response has been formed. The overall performance of this is slightly slower than using async but will generally be simpler to implement.

Methods

impl Client
[src]

Constructs a new stellar synchronous client.

Examples

use stellar_client::sync::Client;
let client = Client::new("https://horizon-testnet.stellar.org").unwrap();

Constructs a new stellar client connected to the horizon test network.

Examples

use stellar_client::sync::Client;
let client = Client::horizon_test().unwrap();

Returns true if this is a test client.

Examples

let client = Client::horizon_test().unwrap();
assert!(!client.is_horizon());
assert!(client.is_horizon_test());

Constructs a new stellar client connected to the horizon prod network.

Examples

use stellar_client::sync::Client;
let client = Client::horizon().unwrap();

Returns true if this is a horizon@stellar client.

Examples

let client = Client::horizon().unwrap();
assert!(client.is_horizon());
assert!(!client.is_horizon_test());

Issues a request to the stellar horizon server synchronously.

Examples

use stellar_client::sync::Client;
use stellar_client::endpoint::account;
let client = Client::horizon_test().unwrap();
let endpoint =
    account::Details::new("GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ");
let account = client.request(endpoint).unwrap();
assert_eq!(account.id(), "GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ");

Trait Implementations

impl Debug for Client
[src]

Formats the value using the given formatter. Read more

impl Clone for Client
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for Client

impl Sync for Client