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.
Constructs a new stellar synchronous client.
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.
use stellar_client::sync::Client;
let client = Client::horizon_test().unwrap();
Returns true if this is a test client.
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.
use stellar_client::sync::Client;
let client = Client::horizon().unwrap();
Returns true if this is a horizon@stellar client.
let client = Client::horizon().unwrap();
assert!(client.is_horizon());
assert!(!client.is_horizon_test());
Issues a request to the stellar horizon server synchronously.
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");
Formats the value using the given formatter. Read more
Performs copy-assignment from source. Read more