Struct diem_client::Client

source ·
pub struct Client { /* private fields */ }

Implementations§

source§

impl Client

source

pub fn new<T: Into<String>>(url: T) -> Self

source

pub fn new_with_retry<T: Into<String>>(url: T, retry: Retry) -> Self

source

pub fn last_known_state(&self) -> Option<State>

source

pub async fn wait_for_signed_transaction( &self, txn: &SignedTransaction, timeout: Option<Duration>, delay: Option<Duration> ) -> Result<Response<TransactionView>, WaitForTransactionError>

source

pub async fn wait_for_transaction( &self, address: AccountAddress, seq: u64, expiration_time_secs: u64, txn_hash: HashValue, timeout: Option<Duration>, delay: Option<Duration> ) -> Result<Response<TransactionView>, WaitForTransactionError>

source

pub async fn batch( &self, requests: Vec<MethodRequest> ) -> Result<Vec<Result<Response<MethodResponse>>>>

source

pub async fn request( &self, request: MethodRequest ) -> Result<Response<MethodResponse>>

source

pub async fn submit(&self, txn: &SignedTransaction) -> Result<Response<()>>

source

pub async fn get_metadata_by_version( &self, version: u64 ) -> Result<Response<MetadataView>>

source

pub async fn get_metadata(&self) -> Result<Response<MetadataView>>

source

pub async fn get_account( &self, address: AccountAddress ) -> Result<Response<Option<AccountView>>>

source

pub async fn get_account_by_version( &self, address: AccountAddress, version: u64 ) -> Result<Response<Option<AccountView>>>

source

pub async fn get_transactions( &self, start_seq: u64, limit: u64, include_events: bool ) -> Result<Response<Vec<TransactionView>>>

source

pub async fn get_account_transaction( &self, address: AccountAddress, seq: u64, include_events: bool ) -> Result<Response<Option<TransactionView>>>

source

pub async fn get_account_transactions( &self, address: AccountAddress, start_seq: u64, limit: u64, include_events: bool ) -> Result<Response<Vec<TransactionView>>>

source

pub async fn get_events( &self, key: EventKey, start_seq: u64, limit: u64 ) -> Result<Response<Vec<EventView>>>

source

pub async fn get_currencies(&self) -> Result<Response<Vec<CurrencyInfoView>>>

source

pub async fn get_network_status(&self) -> Result<Response<u64>>

source

pub async fn get_state_proof( &self, from_version: u64 ) -> Result<Response<StateProofView>>

source

pub async fn get_accumulator_consistency_proof( &self, client_known_version: Option<u64>, ledger_version: Option<u64> ) -> Result<Response<AccumulatorConsistencyProofView>>

source

pub async fn get_account_state_with_proof( &self, address: AccountAddress, from_version: Option<u64>, to_version: Option<u64> ) -> Result<Response<AccountStateWithProofView>>

source

pub async fn get_transactions_with_proofs( &self, start_version: u64, limit: u64, include_events: bool ) -> Result<Response<Option<TransactionsWithProofsView>>>

source

pub async fn get_account_transactions_with_proofs( &self, address: AccountAddress, start_seq: u64, limit: u64, include_events: bool, ledger_version: Option<u64> ) -> Result<Response<AccountTransactionsWithProofView>>

source

pub async fn get_events_with_proofs( &self, key: EventKey, start_seq: u64, limit: u64 ) -> Result<Response<Vec<EventWithProofView>>>

source

pub async fn get_event_by_version_with_proof( &self, key: EventKey, version: Option<u64> ) -> Result<Response<EventByVersionWithProofView>>

source

pub async fn get_deserialized_events<T: MoveStructType + DeserializeOwned>( &self, event_key: &EventKey, start_seq: u64, limit: u64 ) -> Result<Response<Vec<Event<T>>>>

Return the events of type T that have been emitted to event_key since start_seq, with a max of limit results Returns an empty vector if there are no such events The type T must match the event types associated with event_key

source

pub async fn get_deserialized_resource<T: MoveResource>( &self, address: AccountAddress ) -> Result<Response<Option<T>>>

Deserialize and return the resource value of type T stored under address Returns None if there is no such value

Trait Implementations§

source§

impl Clone for Client

source§

fn clone(&self) -> Client

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Client

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · 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 Twhere U: From<T>,

const: unstable · 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
§

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

§

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