Struct WithTimeout

Source
pub struct WithTimeout<T> { /* private fields */ }
Expand description

Wrapper type for any type implementing XandAPIClientTrait that adds a timeout to all requests.

Implementations§

Source§

impl<T> WithTimeout<T>

Source

pub fn new(client: T, timeout: Duration) -> Self

Wraps a XandAPIClientTrait client and returns a client that applies the given timeout to all requests.

Trait Implementations§

Source§

impl<T: Debug> Debug for WithTimeout<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: XandApiClientTrait> XandApiClientTrait for WithTimeout<T>

Source§

fn submit_transaction<'life0, 'async_trait>( &'life0 self, issuer: Address, txn: XandTransaction, ) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Submit a transaction to the API, where it will be signed and then sent to the blockchain Read more
Source§

fn submit_transaction_wait<'life0, 'async_trait>( &'life0 self, issuer: Address, txn: XandTransaction, ) -> Pin<Box<dyn Future<Output = Result<TransactionUpdate, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Like submit_transaction, but rather than returning a stream, returns a future that completes once the the transaction has been committed or invalidated (not finalized).
Source§

fn submit_transaction_wait_final<'life0, 'async_trait>( &'life0 self, issuer: Address, txn: XandTransaction, ) -> Pin<Box<dyn Future<Output = Result<TransactionUpdate, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Submits a transaction and returns its final status (which, in the case of a valid transaction, should eventually be Finalized). Read more
Source§

fn get_transaction_details<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 TransactionId, ) -> Pin<Box<dyn Future<Output = Result<Transaction, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch the details of a particular transaction
Source§

fn get_transaction_history<'life0, 'life1, 'async_trait>( &'life0 self, paging: Option<Paging>, filter: &'life1 TransactionFilter, ) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<Transaction>>, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query transaction history
Source§

fn get_balance<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<u128>, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch the balance (in USD cents) held by an address Read more
Source§

fn get_total_issuance<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<TotalIssuance, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_current_block<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Blockstamp, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Gets the most current block and timestamp with a staleness indicator
Source§

fn get_address_transactions<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 str, paging: Option<Paging>, ) -> Pin<Box<dyn Future<Output = Result<TransactionHistoryPage, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch all transactions which are relevant to the provided address
Source§

fn get_pending_create_requests<'life0, 'async_trait>( &'life0 self, paging: Option<Paging>, ) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<PendingCreateRequest>>, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Request the current pending create requests
Source§

fn get_pending_redeem_requests<'life0, 'async_trait>( &'life0 self, paging: Option<Paging>, ) -> Pin<Box<dyn Future<Output = Result<Paginated<Vec<PendingRedeemRequest>>, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Request the current pending redeem requests
Source§

fn propose_action<'life0, 'async_trait>( &'life0 self, issuer: Address, admin_txn: AdministrativeTransaction, ) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Submit a proposal for an action to be voted on by network
Source§

fn vote_on_proposal<'life0, 'async_trait>( &'life0 self, issuer: Address, vote_proposal: VoteProposal, ) -> Pin<Box<dyn Future<Output = Result<TransactionStatusStream, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Submit vote on specific proposal by id
Source§

fn get_proposal<'life0, 'async_trait>( &'life0 self, id: u32, ) -> Pin<Box<dyn Future<Output = Result<Proposal, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get specific proposal by id
Source§

fn get_all_proposals<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Proposal>, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get all non-expired proposals
Source§

fn get_members<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Address>, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get list of members
Source§

fn get_authority_keys<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<Address>, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get list of validators
Source§

fn get_trustee<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Address, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get trustee address
Source§

fn get_allowlist<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<(Address, CidrBlock)>, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get allowlisted CIDR blocks per address
Source§

fn get_limited_agent<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Option<Address>, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get Limited Agent address if one exists
Source§

fn get_validator_emission_rate<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<ValidatorEmissionRate, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get current Validator emission rate setting
Source§

fn get_validator_emission_progress<'life0, 'async_trait>( &'life0 self, address: Address, ) -> Pin<Box<dyn Future<Output = Result<ValidatorEmissionProgress, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the current progress of an individual validator toward an emission
Source§

fn get_pending_create_request_expire_time<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the current pending create request expire time in milliseconds
Source§

fn check_health<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<HealthResponse, XandApiClientError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Health check
Source§

fn with_timeout(self, timeout: Duration) -> WithTimeout<Self>
where Self: Sized,

Returns a client that behaves like self and applies the given timeout to every asynchronous operation.

Auto Trait Implementations§

§

impl<T> Freeze for WithTimeout<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for WithTimeout<T>
where T: RefUnwindSafe,

§

impl<T> Send for WithTimeout<T>
where T: Send,

§

impl<T> Sync for WithTimeout<T>
where T: Sync,

§

impl<T> Unpin for WithTimeout<T>
where T: Unpin,

§

impl<T> UnwindSafe for WithTimeout<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more