GatewayHttpProxy

Struct GatewayHttpProxy 

Source
pub struct GatewayHttpProxy { /* private fields */ }
Expand description

Allows communication with the MultiversX gateway API.

Implementations§

Source§

impl GatewayHttpProxy

Source

pub async fn get_account(&self, address: &Bech32Address) -> Result<Account>

Examples found in repository?
examples/account.rs (line 11)
5async fn main() {
6    let addr = Bech32Address::from_bech32_string(
7        "erd1qqqqqqqqqqqqqpgqfzydqmdw7m2vazsp6u5p95yxz76t2p9rd8ss0zp9ts".to_owned(),
8    );
9
10    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
11    let account = blockchain.get_account(&addr).await.unwrap();
12
13    println!("account: {account:#?}");
14}
Source

pub async fn get_account_esdt_roles( &self, address: &Bech32Address, ) -> Result<HashMap<String, Vec<String>>>

Source

pub async fn get_account_esdt_tokens( &self, address: &Bech32Address, ) -> Result<HashMap<String, EsdtBalance>>

Examples found in repository?
examples/get_esdt_tokens.rs (line 11)
5async fn main() {
6    let addr = Bech32Address::from_bech32_string(
7        "erd1pdv0h3ddqyzlraek02y5rhmjnwwapjyhqm983kfcdfzmr6axqhdsfg4akx".to_owned(),
8    );
9
10    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
11    let balances = blockchain.get_account_esdt_tokens(&addr).await.unwrap();
12
13    assert!(!balances.is_empty());
14    println!("{balances:#?}");
15}
Source

pub async fn get_account_storage_keys( &self, address: &Bech32Address, ) -> Result<HashMap<String, String>>

Examples found in repository?
examples/account_storage.rs (line 11)
5async fn main() {
6    let addr = Bech32Address::from_bech32_string(
7        "erd1qyu5wthldzr8wx5c9ucg8kjagg0jfs53s8nr3zpz3hypefsdd8ssycr6th".to_owned(),
8    );
9
10    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
11    let account_storage = blockchain.get_account_storage_keys(&addr).await.unwrap();
12
13    assert!(!account_storage.is_empty());
14    println!("Account Storage: {account_storage:#?}");
15}
Source§

impl GatewayHttpProxy

Source

pub async fn get_hyper_block_by_hash(&self, hash: &str) -> Result<HyperBlock>

Examples found in repository?
examples/get_hyper_block_by_hash.rs (line 7)
4async fn main() {
5    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
6    let result = blockchain
7        .get_hyper_block_by_hash("d59e0dc7d407b1175655357cb8056ec3bb77961192753cddda2fb700c6ce71c6")
8        .await;
9
10    assert!(result.is_ok());
11    println!("block by hash result: {result:#?}");
12}
Source

pub async fn get_hyper_block_by_nonce(&self, nonce: u64) -> Result<HyperBlock>

Examples found in repository?
examples/get_hyper_block_by_nonce.rs (line 6)
4async fn main() {
5    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
6    let result = blockchain.get_hyper_block_by_nonce(7468).await;
7
8    assert!(result.is_ok());
9    println!("block by nonce result: {result:#?}")
10}
Source

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

Examples found in repository?
examples/get_hyper_block_latest.rs (line 6)
4async fn main() {
5    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
6    let result = blockchain.get_latest_hyper_block_nonce().await;
7
8    assert!(result.is_ok());
9    println!("latest block result: {result:?}")
10}
Source§

impl GatewayHttpProxy

Source

pub async fn send_user_funds( &self, receiver: &Bech32Address, ) -> Result<String, Error>

Source

pub async fn generate_blocks(&self, num_blocks: u64) -> Result<String, Error>

Source

pub async fn generate_blocks_until_epoch( &self, epoch_number: u64, ) -> Result<String, Error>

Source

pub async fn generate_blocks_until_tx_processed( &self, tx_hash: &str, ) -> Result<String, Error>

Source§

impl GatewayHttpProxy

Source

pub async fn get_network_config(&self) -> Result<NetworkConfig>

Examples found in repository?
examples/get_network_config.rs (line 6)
4async fn main() {
5    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
6    let network_config = blockchain.get_network_config().await.unwrap();
7
8    assert!(!network_config.chain_id.is_empty());
9    println!("network_config: {network_config:#?}")
10}
More examples
Hide additional examples
examples/tx_default_args.rs (line 7)
5async fn main() {
6    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
7    let network_config = blockchain.get_network_config().await.unwrap();
8    let addr = Bech32Address::from_bech32_string(
9        "erd1qqqqqqqqqqqqqpgqfzydqmdw7m2vazsp6u5p95yxz76t2p9rd8ss0zp9ts".to_owned(),
10    );
11
12    let arg = blockchain
13        .get_default_transaction_arguments(&addr.address, &network_config)
14        .await
15        .unwrap();
16
17    let _ = arg.rcv_addr.to_bech32_string();
18    println!("default tx arg: {arg:#?}");
19}
examples/sign_tx.rs (line 12)
5async fn main() {
6    let wl = Wallet::from_private_key(
7        "1648ad209d6b157a289884933e3bb30f161ec7113221ec16f87c3578b05830b0",
8    )
9    .unwrap();
10    let addr = wl.to_address();
11    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
12    let network_config = blockchain.get_network_config().await.unwrap();
13
14    let arg = blockchain
15        .get_default_transaction_arguments(&addr, &network_config)
16        .await
17        .unwrap();
18
19    let mut unsign_tx = Transaction {
20        nonce: arg.nonce,
21        value: "0".to_string(),
22        receiver: addr.to_bech32(&network_config.address_hrp),
23        sender: addr.to_bech32(&network_config.address_hrp),
24        gas_price: arg.gas_price,
25        gas_limit: arg.gas_limit,
26        data: arg.data,
27        signature: None,
28        chain_id: arg.chain_id,
29        version: arg.version,
30        options: arg.options,
31    };
32
33    let signature = wl.sign_tx(&unsign_tx);
34    unsign_tx.signature = Some(hex::encode(signature));
35    let tx_hash = blockchain.send_transaction(&unsign_tx).await.unwrap();
36
37    assert!(!tx_hash.is_empty());
38    println!("tx_hash {tx_hash}");
39}
examples/sign_txs.rs (line 12)
5async fn main() {
6    let wl = Wallet::from_private_key(
7        "1648ad209d6b157a289884933e3bb30f161ec7113221ec16f87c3578b05830b0",
8    )
9    .unwrap();
10    let addr = wl.to_address();
11    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
12    let network_config = blockchain.get_network_config().await.unwrap();
13
14    let arg = blockchain
15        .get_default_transaction_arguments(&addr, &network_config)
16        .await
17        .unwrap();
18
19    let mut unsign_tx = Transaction {
20        nonce: arg.nonce,
21        value: "1000000000000000000".to_string(),
22        receiver: addr.to_bech32(&network_config.address_hrp),
23        sender: addr.to_bech32(&network_config.address_hrp),
24        gas_price: arg.gas_price,
25        gas_limit: arg.gas_limit,
26        data: arg.data,
27        signature: None,
28        chain_id: arg.chain_id,
29        version: arg.version,
30        options: arg.options,
31    };
32
33    let mut txs: Vec<Transaction> = vec![];
34
35    let signature = wl.sign_tx(&unsign_tx);
36    unsign_tx.signature = Some(hex::encode(signature));
37    txs.push(unsign_tx.clone());
38
39    unsign_tx.version = 2;
40    unsign_tx.options = 1;
41    unsign_tx.nonce += 1;
42
43    let signature = wl.sign_tx(&unsign_tx);
44    unsign_tx.signature = Some(hex::encode(signature));
45    txs.push(unsign_tx.clone());
46
47    let tx_hash = blockchain.send_transactions(&txs).await.unwrap();
48
49    assert!(!tx_hash.is_empty());
50    println!("tx_hashes {tx_hash:?}");
51}
Source

pub async fn get_network_economics(&self) -> Result<NetworkEconomics>

Examples found in repository?
examples/get_network_economics.rs (line 6)
4async fn main() {
5    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
6    let network_economics = blockchain.get_network_economics().await.unwrap();
7
8    assert!(!network_economics.dev_rewards.is_empty());
9    println!("network_economics: {network_economics:#?}")
10}
Source§

impl GatewayHttpProxy

Source

pub async fn request_transaction_cost( &self, tx: &Transaction, ) -> Result<TxCostResponseData>

Examples found in repository?
examples/tx_cost.rs (line 27)
7async fn main() {
8    let tx = Transaction {
9        nonce: 1,
10        value: "50".to_string(),
11        receiver: Bech32Address::from_bech32_string(
12            "erd1rh5ws22jxm9pe7dtvhfy6j3uttuupkepferdwtmslms5fydtrh5sx3xr8r".to_owned(),
13        ),
14        sender: Bech32Address::from_bech32_string(
15            "erd1rh5ws22jxm9pe7dtvhfy6j3uttuupkepferdwtmslms5fydtrh5sx3xr8r".to_owned(),
16        ),
17        data: Some(base64_encode("hello")),
18        chain_id: "1".to_string(),
19        version: 1,
20        options: 0,
21        gas_limit: 0,
22        gas_price: 0,
23        signature: None,
24    };
25
26    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
27    let cost = blockchain.request_transaction_cost(&tx).await.unwrap();
28
29    println!("tx cost: {cost:#?}");
30
31    assert_eq!(
32        cost.tx_gas_units, 57500,
33        "receive cost {}",
34        cost.tx_gas_units
35    );
36}
Source

pub async fn get_transaction_info( &self, hash: &str, ) -> Result<TransactionOnNetwork>

Examples found in repository?
examples/tx_info.rs (line 12)
4async fn main() {
5    let tx_hash = "fd21782ddb9e2217a3239e849e39d1d2c8fa74142a73f2dda3adb3028c0514e9";
6    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
7
8    let status = blockchain.get_transaction_status(tx_hash).await;
9    assert!(status.is_ok());
10    println!("tx status: {status:?}");
11
12    let tx = blockchain.get_transaction_info(tx_hash).await;
13    assert!(tx.is_ok());
14    println!("tx: {tx:#?}");
15
16    let tx = blockchain.get_transaction_info_with_results(tx_hash).await;
17    assert!(tx.is_ok());
18    println!("tx with results: {tx:#?}");
19}
Source

pub async fn get_transaction_info_with_results( &self, hash: &str, ) -> Result<TransactionOnNetwork>

Examples found in repository?
examples/tx_info.rs (line 16)
4async fn main() {
5    let tx_hash = "fd21782ddb9e2217a3239e849e39d1d2c8fa74142a73f2dda3adb3028c0514e9";
6    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
7
8    let status = blockchain.get_transaction_status(tx_hash).await;
9    assert!(status.is_ok());
10    println!("tx status: {status:?}");
11
12    let tx = blockchain.get_transaction_info(tx_hash).await;
13    assert!(tx.is_ok());
14    println!("tx: {tx:#?}");
15
16    let tx = blockchain.get_transaction_info_with_results(tx_hash).await;
17    assert!(tx.is_ok());
18    println!("tx with results: {tx:#?}");
19}
Source

pub async fn get_transaction_status(&self, hash: &str) -> Result<String>

Examples found in repository?
examples/tx_info.rs (line 8)
4async fn main() {
5    let tx_hash = "fd21782ddb9e2217a3239e849e39d1d2c8fa74142a73f2dda3adb3028c0514e9";
6    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
7
8    let status = blockchain.get_transaction_status(tx_hash).await;
9    assert!(status.is_ok());
10    println!("tx status: {status:?}");
11
12    let tx = blockchain.get_transaction_info(tx_hash).await;
13    assert!(tx.is_ok());
14    println!("tx: {tx:#?}");
15
16    let tx = blockchain.get_transaction_info_with_results(tx_hash).await;
17    assert!(tx.is_ok());
18    println!("tx with results: {tx:#?}");
19}
Source

pub async fn get_transaction_process_status( &self, hash: &str, ) -> Result<(String, String)>

Source

pub async fn get_default_transaction_arguments( &self, address: &Address, network_configs: &NetworkConfig, ) -> Result<ArgCreateTransaction>

Examples found in repository?
examples/tx_default_args.rs (line 13)
5async fn main() {
6    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
7    let network_config = blockchain.get_network_config().await.unwrap();
8    let addr = Bech32Address::from_bech32_string(
9        "erd1qqqqqqqqqqqqqpgqfzydqmdw7m2vazsp6u5p95yxz76t2p9rd8ss0zp9ts".to_owned(),
10    );
11
12    let arg = blockchain
13        .get_default_transaction_arguments(&addr.address, &network_config)
14        .await
15        .unwrap();
16
17    let _ = arg.rcv_addr.to_bech32_string();
18    println!("default tx arg: {arg:#?}");
19}
More examples
Hide additional examples
examples/sign_tx.rs (line 15)
5async fn main() {
6    let wl = Wallet::from_private_key(
7        "1648ad209d6b157a289884933e3bb30f161ec7113221ec16f87c3578b05830b0",
8    )
9    .unwrap();
10    let addr = wl.to_address();
11    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
12    let network_config = blockchain.get_network_config().await.unwrap();
13
14    let arg = blockchain
15        .get_default_transaction_arguments(&addr, &network_config)
16        .await
17        .unwrap();
18
19    let mut unsign_tx = Transaction {
20        nonce: arg.nonce,
21        value: "0".to_string(),
22        receiver: addr.to_bech32(&network_config.address_hrp),
23        sender: addr.to_bech32(&network_config.address_hrp),
24        gas_price: arg.gas_price,
25        gas_limit: arg.gas_limit,
26        data: arg.data,
27        signature: None,
28        chain_id: arg.chain_id,
29        version: arg.version,
30        options: arg.options,
31    };
32
33    let signature = wl.sign_tx(&unsign_tx);
34    unsign_tx.signature = Some(hex::encode(signature));
35    let tx_hash = blockchain.send_transaction(&unsign_tx).await.unwrap();
36
37    assert!(!tx_hash.is_empty());
38    println!("tx_hash {tx_hash}");
39}
examples/sign_txs.rs (line 15)
5async fn main() {
6    let wl = Wallet::from_private_key(
7        "1648ad209d6b157a289884933e3bb30f161ec7113221ec16f87c3578b05830b0",
8    )
9    .unwrap();
10    let addr = wl.to_address();
11    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
12    let network_config = blockchain.get_network_config().await.unwrap();
13
14    let arg = blockchain
15        .get_default_transaction_arguments(&addr, &network_config)
16        .await
17        .unwrap();
18
19    let mut unsign_tx = Transaction {
20        nonce: arg.nonce,
21        value: "1000000000000000000".to_string(),
22        receiver: addr.to_bech32(&network_config.address_hrp),
23        sender: addr.to_bech32(&network_config.address_hrp),
24        gas_price: arg.gas_price,
25        gas_limit: arg.gas_limit,
26        data: arg.data,
27        signature: None,
28        chain_id: arg.chain_id,
29        version: arg.version,
30        options: arg.options,
31    };
32
33    let mut txs: Vec<Transaction> = vec![];
34
35    let signature = wl.sign_tx(&unsign_tx);
36    unsign_tx.signature = Some(hex::encode(signature));
37    txs.push(unsign_tx.clone());
38
39    unsign_tx.version = 2;
40    unsign_tx.options = 1;
41    unsign_tx.nonce += 1;
42
43    let signature = wl.sign_tx(&unsign_tx);
44    unsign_tx.signature = Some(hex::encode(signature));
45    txs.push(unsign_tx.clone());
46
47    let tx_hash = blockchain.send_transactions(&txs).await.unwrap();
48
49    assert!(!tx_hash.is_empty());
50    println!("tx_hashes {tx_hash:?}");
51}
Source

pub async fn send_transaction(&self, tx: &Transaction) -> Result<String>

Examples found in repository?
examples/sign_tx.rs (line 35)
5async fn main() {
6    let wl = Wallet::from_private_key(
7        "1648ad209d6b157a289884933e3bb30f161ec7113221ec16f87c3578b05830b0",
8    )
9    .unwrap();
10    let addr = wl.to_address();
11    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
12    let network_config = blockchain.get_network_config().await.unwrap();
13
14    let arg = blockchain
15        .get_default_transaction_arguments(&addr, &network_config)
16        .await
17        .unwrap();
18
19    let mut unsign_tx = Transaction {
20        nonce: arg.nonce,
21        value: "0".to_string(),
22        receiver: addr.to_bech32(&network_config.address_hrp),
23        sender: addr.to_bech32(&network_config.address_hrp),
24        gas_price: arg.gas_price,
25        gas_limit: arg.gas_limit,
26        data: arg.data,
27        signature: None,
28        chain_id: arg.chain_id,
29        version: arg.version,
30        options: arg.options,
31    };
32
33    let signature = wl.sign_tx(&unsign_tx);
34    unsign_tx.signature = Some(hex::encode(signature));
35    let tx_hash = blockchain.send_transaction(&unsign_tx).await.unwrap();
36
37    assert!(!tx_hash.is_empty());
38    println!("tx_hash {tx_hash}");
39}
Source

pub async fn send_transactions( &self, txs: &Vec<Transaction>, ) -> Result<Vec<String>>

Examples found in repository?
examples/sign_txs.rs (line 47)
5async fn main() {
6    let wl = Wallet::from_private_key(
7        "1648ad209d6b157a289884933e3bb30f161ec7113221ec16f87c3578b05830b0",
8    )
9    .unwrap();
10    let addr = wl.to_address();
11    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
12    let network_config = blockchain.get_network_config().await.unwrap();
13
14    let arg = blockchain
15        .get_default_transaction_arguments(&addr, &network_config)
16        .await
17        .unwrap();
18
19    let mut unsign_tx = Transaction {
20        nonce: arg.nonce,
21        value: "1000000000000000000".to_string(),
22        receiver: addr.to_bech32(&network_config.address_hrp),
23        sender: addr.to_bech32(&network_config.address_hrp),
24        gas_price: arg.gas_price,
25        gas_limit: arg.gas_limit,
26        data: arg.data,
27        signature: None,
28        chain_id: arg.chain_id,
29        version: arg.version,
30        options: arg.options,
31    };
32
33    let mut txs: Vec<Transaction> = vec![];
34
35    let signature = wl.sign_tx(&unsign_tx);
36    unsign_tx.signature = Some(hex::encode(signature));
37    txs.push(unsign_tx.clone());
38
39    unsign_tx.version = 2;
40    unsign_tx.options = 1;
41    unsign_tx.nonce += 1;
42
43    let signature = wl.sign_tx(&unsign_tx);
44    unsign_tx.signature = Some(hex::encode(signature));
45    txs.push(unsign_tx.clone());
46
47    let tx_hash = blockchain.send_transactions(&txs).await.unwrap();
48
49    assert!(!tx_hash.is_empty());
50    println!("tx_hashes {tx_hash:?}");
51}
Source

pub async fn execute_vmquery( &self, vm_request: &VMQueryInput, ) -> Result<VmValuesResponseData>

Examples found in repository?
examples/vm_query.rs (line 15)
5async fn main() {
6    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
7    let sc_address = Bech32Address::from_bech32_string(
8        "erd1qqqqqqqqqqqqqpgq5dvvkmka7sujfsx7cfmygnx0n7luv8k0d8sskpqcec".to_owned(),
9    );
10    let req = VMQueryInput {
11        sc_address: sc_address.clone(),
12        func_name: "empty".to_string(),
13        args: vec![],
14    };
15    let result = blockchain.execute_vmquery(&req).await;
16    assert!(result.is_ok());
17    println!("{result:#?}");
18}
Source§

impl GatewayHttpProxy

Source

pub fn new(proxy_uri: String) -> Self

Examples found in repository?
examples/get_hyper_block_latest.rs (line 5)
4async fn main() {
5    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
6    let result = blockchain.get_latest_hyper_block_nonce().await;
7
8    assert!(result.is_ok());
9    println!("latest block result: {result:?}")
10}
More examples
Hide additional examples
examples/get_hyper_block_by_nonce.rs (line 5)
4async fn main() {
5    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
6    let result = blockchain.get_hyper_block_by_nonce(7468).await;
7
8    assert!(result.is_ok());
9    println!("block by nonce result: {result:#?}")
10}
examples/get_network_config.rs (line 5)
4async fn main() {
5    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
6    let network_config = blockchain.get_network_config().await.unwrap();
7
8    assert!(!network_config.chain_id.is_empty());
9    println!("network_config: {network_config:#?}")
10}
examples/get_network_economics.rs (line 5)
4async fn main() {
5    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
6    let network_economics = blockchain.get_network_economics().await.unwrap();
7
8    assert!(!network_economics.dev_rewards.is_empty());
9    println!("network_economics: {network_economics:#?}")
10}
examples/get_hyper_block_by_hash.rs (line 5)
4async fn main() {
5    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
6    let result = blockchain
7        .get_hyper_block_by_hash("d59e0dc7d407b1175655357cb8056ec3bb77961192753cddda2fb700c6ce71c6")
8        .await;
9
10    assert!(result.is_ok());
11    println!("block by hash result: {result:#?}");
12}
examples/account.rs (line 10)
5async fn main() {
6    let addr = Bech32Address::from_bech32_string(
7        "erd1qqqqqqqqqqqqqpgqfzydqmdw7m2vazsp6u5p95yxz76t2p9rd8ss0zp9ts".to_owned(),
8    );
9
10    let blockchain = GatewayHttpProxy::new(DEVNET_GATEWAY.to_string());
11    let account = blockchain.get_account(&addr).await.unwrap();
12
13    println!("account: {account:#?}");
14}
Source

pub async fn http_request<G>(&self, request: G) -> Result<G::Result>
where G: GatewayRequest,

Performs a request to the gateway. Can be either GET or POST, depending on the argument.

Trait Implementations§

Source§

impl Clone for GatewayHttpProxy

Source§

fn clone(&self) -> GatewayHttpProxy

Returns a duplicate 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 GatewayHttpProxy

Source§

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

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

impl GatewayAsyncService for GatewayHttpProxy

Source§

type Instant = Instant

Keeps track of elapsed time.
Source§

fn from_uri(uri: &str) -> Self

Source§

fn request<G>(&self, request: G) -> impl Future<Output = Result<G::Result>>
where G: GatewayRequest,

Source§

fn sleep(&self, millis: u64) -> impl Future<Output = ()>

Source§

fn now(&self) -> Self::Instant

Source§

fn elapsed_seconds(&self, instant: &Self::Instant) -> f32

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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 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
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T