pub struct Drk {
pub cache: Cache,
pub wallet: WalletPtr,
pub rpc_client: Option<RwLock<DarkfidRpcClient>>,
pub fun: bool,
}Expand description
CLI-util structure
Fields§
§cache: CacheBlockchain cache database operations handler
wallet: WalletPtrWallet database operations handler
rpc_client: Option<RwLock<DarkfidRpcClient>>JSON-RPC client to execute requests to darkfid daemon
fun: boolFlag indicating if fun stuff are enabled
Implementations§
Source§impl Drk
impl Drk
Sourcepub async fn scan_cache(&self) -> Result<ScanCache>
pub async fn scan_cache(&self) -> Result<ScanCache>
Auxiliary function to generate a new ScanCache for the
wallet.
Sourceasync fn scan_block(
&self,
scan_cache: &mut ScanCache,
block: &BlockInfo,
) -> Result<()>
async fn scan_block( &self, scan_cache: &mut ScanCache, block: &BlockInfo, ) -> Result<()>
scan_block will go over over transactions in a block and handle their calls
based on the called contract.
Sourcepub async fn scan_blocks(
&self,
output: &mut Vec<String>,
sender: Option<&Sender<Vec<String>>>,
print: &bool,
) -> WalletDbResult<()>
pub async fn scan_blocks( &self, output: &mut Vec<String>, sender: Option<&Sender<Vec<String>>>, print: &bool, ) -> WalletDbResult<()>
Scans the blockchain for wallet relevant transactions, starting from the last scanned block. If a reorg has happened, we revert to its previous height and then scan from there.
async fn get_last_confirmed_block(&self) -> Result<(u32, String)>
async fn get_block_by_height(&self, height: u32) -> Result<BlockInfo>
Sourcepub async fn broadcast_tx(
&self,
tx: &Transaction,
output: &mut Vec<String>,
) -> Result<String>
pub async fn broadcast_tx( &self, tx: &Transaction, output: &mut Vec<String>, ) -> Result<String>
Broadcast a given transaction to darkfid and forward onto the network. Returns the transaction ID upon success.
Sourcepub async fn get_tx(
&self,
tx_hash: &TransactionHash,
) -> Result<Option<Transaction>>
pub async fn get_tx( &self, tx_hash: &TransactionHash, ) -> Result<Option<Transaction>>
Queries darkfid for a tx with given hash.
Sourcepub async fn simulate_tx(&self, tx: &Transaction) -> Result<bool>
pub async fn simulate_tx(&self, tx: &Transaction) -> Result<bool>
Simulate the transaction with the state machine.
Sourcepub async fn lookup_zkas(
&self,
contract_id: &ContractId,
) -> Result<Vec<(String, Vec<u8>)>>
pub async fn lookup_zkas( &self, contract_id: &ContractId, ) -> Result<Vec<(String, Vec<u8>)>>
Try to fetch zkas bincodes for the given ContractId.
Sourcepub async fn get_tx_fee(
&self,
tx: &Transaction,
include_fee: bool,
) -> Result<u64>
pub async fn get_tx_fee( &self, tx: &Transaction, include_fee: bool, ) -> Result<u64>
Queries darkfid for given transaction’s required fee.
Sourcepub async fn get_next_block_height(&self) -> Result<u32>
pub async fn get_next_block_height(&self) -> Result<u32>
Queries darkfid for current best fork next height.
Sourcepub async fn get_block_target(&self) -> Result<u32>
pub async fn get_block_target(&self) -> Result<u32>
Queries darkfid for currently configured block target time.
Sourcepub async fn ping(&self, output: &mut Vec<String>) -> Result<()>
pub async fn ping(&self, output: &mut Vec<String>) -> Result<()>
Auxiliary function to ping configured darkfid daemon for liveness.
Sourcepub async fn darkfid_daemon_request(
&self,
method: &str,
params: &JsonValue,
) -> Result<JsonValue>
pub async fn darkfid_daemon_request( &self, method: &str, params: &JsonValue, ) -> Result<JsonValue>
Auxiliary function to execute a request towards the configured darkfid daemon JSON-RPC endpoint.
Sourcepub async fn stop_rpc_client(&self) -> Result<()>
pub async fn stop_rpc_client(&self) -> Result<()>
Auxiliary function to stop current JSON-RPC client, if its initialized.
Source§impl Drk
impl Drk
Sourcepub async fn init_swap(
&self,
value_pair: (u64, u64),
token_pair: (TokenId, TokenId),
user_data_blind_send: Option<BaseBlind>,
spend_hook_recv: Option<FuncId>,
user_data_recv: Option<Base>,
) -> Result<PartialSwapData>
pub async fn init_swap( &self, value_pair: (u64, u64), token_pair: (TokenId, TokenId), user_data_blind_send: Option<BaseBlind>, spend_hook_recv: Option<FuncId>, user_data_recv: Option<Base>, ) -> Result<PartialSwapData>
Initialize the first half of an atomic swap
Sourcepub async fn join_swap(
&self,
partial: PartialSwapData,
user_data_blind_send: Option<BaseBlind>,
spend_hook_recv: Option<FuncId>,
user_data_recv: Option<Base>,
) -> Result<Transaction>
pub async fn join_swap( &self, partial: PartialSwapData, user_data_blind_send: Option<BaseBlind>, spend_hook_recv: Option<FuncId>, user_data_recv: Option<Base>, ) -> Result<Transaction>
Create a full transaction by inspecting and verifying given partial swap data,
making the other half, and joining all this into a Transaction object.
Sourcepub async fn inspect_swap(
&self,
bytes: Vec<u8>,
output: &mut Vec<String>,
) -> Result<()>
pub async fn inspect_swap( &self, bytes: Vec<u8>, output: &mut Vec<String>, ) -> Result<()>
Inspect and verify a given swap (half or full) transaction
Sourcepub async fn sign_swap(&self, tx: &mut Transaction) -> Result<()>
pub async fn sign_swap(&self, tx: &mut Transaction) -> Result<()>
Sign given swap transaction by retrieving the secret key from the encrypted note and prepending it to the transaction’s signatures.
Source§impl Drk
impl Drk
Sourcefn derive_token_attributes(
&self,
mint_authority: SecretKey,
token_blind: BaseBlind,
) -> TokenAttributes
fn derive_token_attributes( &self, mint_authority: SecretKey, token_blind: BaseBlind, ) -> TokenAttributes
Auxiliary function to derive TokenAttributes for provided secret key and token blind.
Import a token mint authority into the wallet.
Auxiliary function to parse a MONEY_TOKENS_TABLE records.
The boolean in the returned tuples notes if the token mint authority is frozen.
Reset all token mint authorities frozen status in the wallet.
Remove token mint authorities frozen status in the wallet that where frozen after provided height.
Fetch all token mint authorities from the wallet.
Fetch provided token unfrozen mint authority from the wallet.
Sourcepub async fn mint_token(
&self,
amount: &str,
recipient: PublicKey,
token_id: TokenId,
spend_hook: Option<FuncId>,
user_data: Option<Base>,
) -> Result<Transaction>
pub async fn mint_token( &self, amount: &str, recipient: PublicKey, token_id: TokenId, spend_hook: Option<FuncId>, user_data: Option<Base>, ) -> Result<Transaction>
Create a token mint transaction. Returns the transaction object on success.
Sourcepub async fn freeze_token(&self, token_id: TokenId) -> Result<Transaction>
pub async fn freeze_token(&self, token_id: TokenId) -> Result<Transaction>
Create a token freeze transaction. Returns the transaction object on success.
Source§impl Drk
impl Drk
Sourcepub async fn initialize_money(
&self,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub async fn initialize_money( &self, output: &mut Vec<String>, ) -> WalletDbResult<()>
Initialize wallet with tables for the Money contract.
Sourcepub async fn money_keygen(&self, output: &mut Vec<String>) -> WalletDbResult<()>
pub async fn money_keygen(&self, output: &mut Vec<String>) -> WalletDbResult<()>
Generate a new keypair and place it into the wallet.
Sourcepub async fn default_secret(&self) -> Result<SecretKey>
pub async fn default_secret(&self) -> Result<SecretKey>
Fetch default secret key from the wallet.
Sourcepub async fn default_address(&self) -> Result<PublicKey>
pub async fn default_address(&self) -> Result<PublicKey>
Fetch default pubkey from the wallet.
Sourcepub fn set_default_address(&self, idx: usize) -> WalletDbResult<()>
pub fn set_default_address(&self, idx: usize) -> WalletDbResult<()>
Set provided index address as default in the wallet.
Sourcepub async fn addresses(&self) -> Result<Vec<(u64, PublicKey, SecretKey, u64)>>
pub async fn addresses(&self) -> Result<Vec<(u64, PublicKey, SecretKey, u64)>>
Fetch all pukeys from the wallet.
Sourcepub async fn get_money_secrets(&self) -> Result<Vec<SecretKey>>
pub async fn get_money_secrets(&self) -> Result<Vec<SecretKey>>
Fetch all secret keys from the wallet.
Sourcepub async fn import_money_secrets(
&self,
secrets: Vec<SecretKey>,
output: &mut Vec<String>,
) -> Result<Vec<PublicKey>>
pub async fn import_money_secrets( &self, secrets: Vec<SecretKey>, output: &mut Vec<String>, ) -> Result<Vec<PublicKey>>
Import given secret keys into the wallet. If the key already exists, it will be skipped. Returns the respective PublicKey objects for the imported keys.
Sourcepub async fn money_balance(&self) -> Result<HashMap<String, u64>>
pub async fn money_balance(&self) -> Result<HashMap<String, u64>>
Fetch known unspent balances from the wallet and return them as a hashmap.
Sourcepub async fn get_coins(
&self,
fetch_spent: bool,
) -> Result<Vec<(OwnCoin, u32, bool, Option<u32>, String)>>
pub async fn get_coins( &self, fetch_spent: bool, ) -> Result<Vec<(OwnCoin, u32, bool, Option<u32>, String)>>
Fetch all coins and their metadata related to the Money contract from the wallet. Optionally also fetch spent ones. The boolean in the returned tuple notes if the coin was marked as spent, along with the height and tx it was spent in.
Sourcepub async fn get_token_coins(&self, token_id: &TokenId) -> Result<Vec<OwnCoin>>
pub async fn get_token_coins(&self, token_id: &TokenId) -> Result<Vec<OwnCoin>>
Fetch provided token unspend balances from the wallet.
Sourcepub async fn get_contract_token_coins(
&self,
token_id: &TokenId,
spend_hook: &FuncId,
user_data: &Base,
) -> Result<Vec<OwnCoin>>
pub async fn get_contract_token_coins( &self, token_id: &TokenId, spend_hook: &FuncId, user_data: &Base, ) -> Result<Vec<OwnCoin>>
Fetch provided contract specified token unspend balances from the wallet.
Sourceasync fn parse_coin_record(
&self,
row: &[Value],
) -> Result<(OwnCoin, u32, bool, Option<u32>, String)>
async fn parse_coin_record( &self, row: &[Value], ) -> Result<(OwnCoin, u32, bool, Option<u32>, String)>
Auxiliary function to parse a MONEY_COINS_TABLE record.
The boolean in the returned tuple notes if the coin was marked
as spent, along with the height and tx it was spent in.
Sourcepub async fn add_alias(
&self,
alias: String,
token_id: TokenId,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub async fn add_alias( &self, alias: String, token_id: TokenId, output: &mut Vec<String>, ) -> WalletDbResult<()>
Create an alias record for provided Token ID.
Sourcepub async fn get_aliases(
&self,
alias_filter: Option<String>,
token_id_filter: Option<TokenId>,
) -> Result<HashMap<String, TokenId>>
pub async fn get_aliases( &self, alias_filter: Option<String>, token_id_filter: Option<TokenId>, ) -> Result<HashMap<String, TokenId>>
Fetch all aliases from the wallet. Optionally filter using alias name and/or token id.
Sourcepub async fn get_aliases_mapped_by_token(
&self,
) -> Result<HashMap<String, String>>
pub async fn get_aliases_mapped_by_token( &self, ) -> Result<HashMap<String, String>>
Fetch all aliases from the wallet, mapped by token id.
Sourcepub async fn remove_alias(
&self,
alias: String,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub async fn remove_alias( &self, alias: String, output: &mut Vec<String>, ) -> WalletDbResult<()>
Remove provided alias record from the wallet database.
Sourcepub async fn unspend_coin(&self, coin: &Coin) -> WalletDbResult<()>
pub async fn unspend_coin(&self, coin: &Coin) -> WalletDbResult<()>
Mark a given coin in the wallet as unspent.
Sourcepub async fn get_money_tree(&self) -> Result<MerkleTree>
pub async fn get_money_tree(&self) -> Result<MerkleTree>
Fetch the Money Merkle tree from the cache. If it doesn’t exists a new Merkle Tree is returned.
Sourceasync fn parse_money_call(
&self,
scan_cache: &mut ScanCache,
call_idx: &usize,
calls: &[DarkLeaf<ContractCall>],
) -> Result<(Vec<Nullifier>, Vec<(Coin, AeadEncryptedNote)>, Vec<TokenId>)>
async fn parse_money_call( &self, scan_cache: &mut ScanCache, call_idx: &usize, calls: &[DarkLeaf<ContractCall>], ) -> Result<(Vec<Nullifier>, Vec<(Coin, AeadEncryptedNote)>, Vec<TokenId>)>
Auxiliary function to grab all the nullifiers, coins with their notes and freezes from a transaction money call.
Sourcefn handle_money_call_coins(
&self,
tree: &mut MerkleTree,
secrets: &[SecretKey],
messages_buffer: &mut Vec<String>,
coins: &[(Coin, AeadEncryptedNote)],
) -> Vec<OwnCoin>
fn handle_money_call_coins( &self, tree: &mut MerkleTree, secrets: &[SecretKey], messages_buffer: &mut Vec<String>, coins: &[(Coin, AeadEncryptedNote)], ) -> Vec<OwnCoin>
Auxiliary function to handle coins with their notes from a transaction money call. Returns our found own coins.
Sourceasync fn handle_money_call_owncoins(
&self,
scan_cache: &mut ScanCache,
coins: &[OwnCoin],
creation_height: &u32,
) -> Result<()>
async fn handle_money_call_owncoins( &self, scan_cache: &mut ScanCache, coins: &[OwnCoin], creation_height: &u32, ) -> Result<()>
Auxiliary function to handle own coins from a transaction money call.
Sourceasync fn handle_money_call_freezes(
&self,
own_tokens: &[TokenId],
freezes: &[TokenId],
freeze_height: &u32,
) -> Result<bool>
async fn handle_money_call_freezes( &self, own_tokens: &[TokenId], freezes: &[TokenId], freeze_height: &u32, ) -> Result<bool>
Auxiliary function to handle freezes from a transaction money call. Returns a flag indicating if provided freezes refer to our own wallet.
Sourcepub async fn apply_tx_money_data(
&self,
scan_cache: &mut ScanCache,
call_idx: &usize,
calls: &[DarkLeaf<ContractCall>],
tx_hash: &String,
block_height: &u32,
) -> Result<bool>
pub async fn apply_tx_money_data( &self, scan_cache: &mut ScanCache, call_idx: &usize, calls: &[DarkLeaf<ContractCall>], tx_hash: &String, block_height: &u32, ) -> Result<bool>
Append data related to Money contract transactions into the wallet database and update the provided scan cache. Returns a flag indicating if provided data refer to our own wallet.
Sourceasync fn money_call_nullifiers(
&self,
call: &DarkLeaf<ContractCall>,
) -> Result<Vec<Nullifier>>
async fn money_call_nullifiers( &self, call: &DarkLeaf<ContractCall>, ) -> Result<Vec<Nullifier>>
Auxiliary function to grab all the nullifiers from a transaction money call.
Sourcepub async fn mark_tx_spend(
&self,
tx: &Transaction,
output: &mut Vec<String>,
) -> Result<()>
pub async fn mark_tx_spend( &self, tx: &Transaction, output: &mut Vec<String>, ) -> Result<()>
Mark provided transaction input coins as spent.
Sourcepub fn mark_spent_coins(
&self,
tree: Option<&mut MerkleTree>,
owncoins_nullifiers: &BTreeMap<[u8; 32], ([u8; 32], Position)>,
nullifiers: &[Nullifier],
spent_height: &Option<u32>,
spent_tx_hash: &String,
) -> Result<bool>
pub fn mark_spent_coins( &self, tree: Option<&mut MerkleTree>, owncoins_nullifiers: &BTreeMap<[u8; 32], ([u8; 32], Position)>, nullifiers: &[Nullifier], spent_height: &Option<u32>, spent_tx_hash: &String, ) -> Result<bool>
Marks all coins in the wallet as spent, if their nullifier is in the given set. Returns a flag indicating if any of the provided nullifiers refer to our own wallet.
Sourcepub fn smt_insert(
&self,
smt: &mut CacheSmt,
nullifiers: &[Nullifier],
) -> Result<()>
pub fn smt_insert( &self, smt: &mut CacheSmt, nullifiers: &[Nullifier], ) -> Result<()>
Inserts given slice to the wallets nullifiers Sparse Merkle Tree.
Sourcepub fn reset_money_tree(&self, output: &mut Vec<String>) -> WalletDbResult<()>
pub fn reset_money_tree(&self, output: &mut Vec<String>) -> WalletDbResult<()>
Reset the Money Merkle tree in the cache.
Sourcepub fn reset_money_smt(&self, output: &mut Vec<String>) -> WalletDbResult<()>
pub fn reset_money_smt(&self, output: &mut Vec<String>) -> WalletDbResult<()>
Reset the Money nullifiers Sparse Merkle Tree in the cache.
Sourcepub fn reset_money_coins(&self, output: &mut Vec<String>) -> WalletDbResult<()>
pub fn reset_money_coins(&self, output: &mut Vec<String>) -> WalletDbResult<()>
Reset the Money coins in the wallet.
Sourcepub fn remove_money_coins_after(
&self,
height: &u32,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub fn remove_money_coins_after( &self, height: &u32, output: &mut Vec<String>, ) -> WalletDbResult<()>
Remove the Money coins in the wallet that were created after provided height.
Sourcepub fn unspent_money_coins_after(
&self,
height: &u32,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub fn unspent_money_coins_after( &self, height: &u32, output: &mut Vec<String>, ) -> WalletDbResult<()>
Mark the Money coins in the wallet that were spent after provided height as unspent.
Sourcepub async fn get_token(&self, input: String) -> Result<TokenId>
pub async fn get_token(&self, input: String) -> Result<TokenId>
Retrieve token by provided string. Input string represents either an alias or a token id.
Sourcepub async fn append_fee_call(
&self,
tx: &Transaction,
money_merkle_tree: &MerkleTree,
fee_pk: &ProvingKey,
fee_zkbin: &ZkBinary,
spent_coins: Option<&[OwnCoin]>,
) -> Result<(ContractCall, Vec<Proof>, Vec<SecretKey>)>
pub async fn append_fee_call( &self, tx: &Transaction, money_merkle_tree: &MerkleTree, fee_pk: &ProvingKey, fee_zkbin: &ZkBinary, spent_coins: Option<&[OwnCoin]>, ) -> Result<(ContractCall, Vec<Proof>, Vec<SecretKey>)>
Create and append a Money::Fee call to a given Transaction.
Optionally takes a set of spent coins in order not to reuse them here.
Returns the Fee call, and all necessary data and parameters related.
Sourcepub async fn attach_fee(&self, tx: &mut Transaction) -> Result<()>
pub async fn attach_fee(&self, tx: &mut Transaction) -> Result<()>
Create and attach the fee call to given transaction.
Source§impl Drk
impl Drk
Sourcepub async fn initialize_dao(&self) -> WalletDbResult<()>
pub async fn initialize_dao(&self) -> WalletDbResult<()>
Initialize wallet with tables for the DAO contract.
Sourcepub async fn get_dao_trees(&self) -> Result<(MerkleTree, MerkleTree)>
pub async fn get_dao_trees(&self) -> Result<(MerkleTree, MerkleTree)>
Fetch DAO Merkle trees from the wallet. If a tree doesn’t exists a new Merkle Tree is returned.
Sourceasync fn parse_dao_record(&self, row: &[Value]) -> Result<DaoRecord>
async fn parse_dao_record(&self, row: &[Value]) -> Result<DaoRecord>
Auxiliary function to parse a DAO_DAOS_TABLE record.
Sourceasync fn parse_dao_proposal(&self, row: &[Value]) -> Result<ProposalRecord>
async fn parse_dao_proposal(&self, row: &[Value]) -> Result<ProposalRecord>
Auxiliary function to parse a proposal record row.
Sourcepub async fn get_dao_proposals(&self, name: &str) -> Result<Vec<ProposalRecord>>
pub async fn get_dao_proposals(&self, name: &str) -> Result<Vec<ProposalRecord>>
Fetch all known DAO proposals from the wallet given a DAO name.
Sourceasync fn apply_dao_mint_data(
&self,
scan_cache: &mut ScanCache,
new_bulla: &DaoBulla,
tx_hash: &TransactionHash,
call_index: &u8,
mint_height: &u32,
) -> Result<bool>
async fn apply_dao_mint_data( &self, scan_cache: &mut ScanCache, new_bulla: &DaoBulla, tx_hash: &TransactionHash, call_index: &u8, mint_height: &u32, ) -> Result<bool>
Auxiliary function to apply DaoFunction::Mint call data to
the wallet and update the provided scan cache.
Returns a flag indicating if the provided call refers to our
own wallet.
Sourceasync fn apply_dao_propose_data(
&self,
scan_cache: &mut ScanCache,
params: &DaoProposeParams,
tx_hash: &TransactionHash,
call_index: &u8,
mint_height: &u32,
) -> Result<bool>
async fn apply_dao_propose_data( &self, scan_cache: &mut ScanCache, params: &DaoProposeParams, tx_hash: &TransactionHash, call_index: &u8, mint_height: &u32, ) -> Result<bool>
Auxiliary function to apply DaoFunction::Propose call data to
the wallet and update the provided scan cache.
Returns a flag indicating if the provided call refers to our
own wallet.
Sourceasync fn apply_dao_vote_data(
&self,
scan_cache: &ScanCache,
params: &DaoVoteParams,
tx_hash: &TransactionHash,
call_index: &u8,
block_height: &u32,
) -> Result<bool>
async fn apply_dao_vote_data( &self, scan_cache: &ScanCache, params: &DaoVoteParams, tx_hash: &TransactionHash, call_index: &u8, block_height: &u32, ) -> Result<bool>
Auxiliary function to apply DaoFunction::Vote call data to
the wallet.
Returns a flag indicating if the provided call refers to our
own wallet.
Sourceasync fn apply_dao_exec_data(
&self,
scan_cache: &ScanCache,
params: &DaoExecParams,
tx_hash: &TransactionHash,
exec_height: &u32,
) -> Result<bool>
async fn apply_dao_exec_data( &self, scan_cache: &ScanCache, params: &DaoExecParams, tx_hash: &TransactionHash, exec_height: &u32, ) -> Result<bool>
Auxiliary function to apply DaoFunction::Exec call data to
the wallet and update the provided scan cache.
Returns a flag indicating if the provided call refers to our
own wallet.
Sourcepub async fn apply_tx_dao_data(
&self,
scan_cache: &mut ScanCache,
data: &[u8],
tx_hash: &TransactionHash,
call_idx: &u8,
block_height: &u32,
) -> Result<bool>
pub async fn apply_tx_dao_data( &self, scan_cache: &mut ScanCache, data: &[u8], tx_hash: &TransactionHash, call_idx: &u8, block_height: &u32, ) -> Result<bool>
Append data related to DAO contract transactions into the wallet database and update the provided scan cache. Returns a flag indicating if provided data refer to our own wallet.
Sourcepub async fn confirm_dao(
&self,
dao: &DaoBulla,
leaf_position: &Position,
tx_hash: &TransactionHash,
call_index: &u8,
mint_height: &u32,
) -> WalletDbResult<()>
pub async fn confirm_dao( &self, dao: &DaoBulla, leaf_position: &Position, tx_hash: &TransactionHash, call_index: &u8, mint_height: &u32, ) -> WalletDbResult<()>
Confirm already imported DAO metadata into the wallet. Here we just write the leaf position, mint height, tx hash, and call index.
Sourcepub async fn put_dao_proposal(&self, proposal: &ProposalRecord) -> Result<()>
pub async fn put_dao_proposal(&self, proposal: &ProposalRecord) -> Result<()>
Import given DAO proposal into the wallet.
Sourcepub async fn put_dao_vote(&self, vote: &VoteRecord) -> WalletDbResult<()>
pub async fn put_dao_vote(&self, vote: &VoteRecord) -> WalletDbResult<()>
Import given DAO vote into the wallet.
Sourcepub fn reset_dao_trees(&self, output: &mut Vec<String>) -> WalletDbResult<()>
pub fn reset_dao_trees(&self, output: &mut Vec<String>) -> WalletDbResult<()>
Reset the DAO Merkle trees in the cache.
Sourcepub fn reset_daos(&self, output: &mut Vec<String>) -> WalletDbResult<()>
pub fn reset_daos(&self, output: &mut Vec<String>) -> WalletDbResult<()>
Reset confirmed DAOs in the wallet.
Sourcepub fn unconfirm_daos_after(
&self,
height: &u32,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub fn unconfirm_daos_after( &self, height: &u32, output: &mut Vec<String>, ) -> WalletDbResult<()>
Reset confirmed DAOs in the wallet that were minted after provided height.
Sourcepub fn reset_dao_proposals(
&self,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub fn reset_dao_proposals( &self, output: &mut Vec<String>, ) -> WalletDbResult<()>
Reset all DAO proposals in the wallet.
Sourcepub fn unconfirm_dao_proposals_after(
&self,
height: &u32,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub fn unconfirm_dao_proposals_after( &self, height: &u32, output: &mut Vec<String>, ) -> WalletDbResult<()>
Reset DAO proposals in the wallet that were minted after provided height.
Sourcepub fn unexec_dao_proposals_after(
&self,
height: &u32,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub fn unexec_dao_proposals_after( &self, height: &u32, output: &mut Vec<String>, ) -> WalletDbResult<()>
Reset execution information in the wallet for DAO proposals that were executed after provided height.
Sourcepub fn reset_dao_votes(&self, output: &mut Vec<String>) -> WalletDbResult<()>
pub fn reset_dao_votes(&self, output: &mut Vec<String>) -> WalletDbResult<()>
Reset all DAO votes in the wallet.
Sourcepub fn remove_dao_votes_after(
&self,
height: &u32,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub fn remove_dao_votes_after( &self, height: &u32, output: &mut Vec<String>, ) -> WalletDbResult<()>
Remove the DAO votes in the wallet that were created after provided height.
Sourcepub async fn import_dao(
&self,
name: &str,
params: &DaoParams,
output: &mut Vec<String>,
) -> Result<()>
pub async fn import_dao( &self, name: &str, params: &DaoParams, output: &mut Vec<String>, ) -> Result<()>
Import given DAO params into the wallet with a given name.
Sourcepub async fn get_dao_by_bulla(&self, bulla: &DaoBulla) -> Result<DaoRecord>
pub async fn get_dao_by_bulla(&self, bulla: &DaoBulla) -> Result<DaoRecord>
Fetch a DAO given its bulla.
Sourcepub async fn get_dao_by_name(&self, name: &str) -> Result<DaoRecord>
pub async fn get_dao_by_name(&self, name: &str) -> Result<DaoRecord>
Fetch a DAO given its name.
Sourcepub async fn dao_list(
&self,
name: &Option<String>,
output: &mut Vec<String>,
) -> Result<()>
pub async fn dao_list( &self, name: &Option<String>, output: &mut Vec<String>, ) -> Result<()>
List DAO(s) imported in the wallet. If a name is given, just print the metadata for that specific one, if found.
Sourcepub async fn dao_balance(&self, name: &str) -> Result<HashMap<String, u64>>
pub async fn dao_balance(&self, name: &str) -> Result<HashMap<String, u64>>
Fetch known unspent balances from the wallet for the given DAO name.
Sourcepub async fn get_proposals(&self) -> Result<Vec<ProposalRecord>>
pub async fn get_proposals(&self) -> Result<Vec<ProposalRecord>>
Fetch all known DAO proposalss from the wallet.
Sourcepub async fn get_dao_proposal_by_bulla(
&self,
bulla: &DaoProposalBulla,
) -> Result<ProposalRecord>
pub async fn get_dao_proposal_by_bulla( &self, bulla: &DaoProposalBulla, ) -> Result<ProposalRecord>
Fetch a DAO proposal by its bulla.
pub async fn get_dao_proposal_votes( &self, proposal: &DaoProposalBulla, ) -> Result<Vec<VoteRecord>>
Sourcepub async fn dao_mint(&self, name: &str) -> Result<Transaction>
pub async fn dao_mint(&self, name: &str) -> Result<Transaction>
Mint a DAO on-chain.
Sourcepub async fn dao_propose_transfer(
&self,
name: &str,
duration_blockwindows: u64,
amount: &str,
token_id: TokenId,
recipient: PublicKey,
spend_hook: Option<FuncId>,
user_data: Option<Base>,
) -> Result<ProposalRecord>
pub async fn dao_propose_transfer( &self, name: &str, duration_blockwindows: u64, amount: &str, token_id: TokenId, recipient: PublicKey, spend_hook: Option<FuncId>, user_data: Option<Base>, ) -> Result<ProposalRecord>
Create a DAO transfer proposal.
Sourcepub async fn dao_propose_generic(
&self,
name: &str,
duration_blockwindows: u64,
user_data: Option<Base>,
) -> Result<ProposalRecord>
pub async fn dao_propose_generic( &self, name: &str, duration_blockwindows: u64, user_data: Option<Base>, ) -> Result<ProposalRecord>
Create a DAO generic proposal.
Sourcepub async fn dao_transfer_proposal_tx(
&self,
proposal: &ProposalRecord,
) -> Result<Transaction>
pub async fn dao_transfer_proposal_tx( &self, proposal: &ProposalRecord, ) -> Result<Transaction>
Create a DAO transfer proposal transaction.
Sourcepub async fn dao_generic_proposal_tx(
&self,
proposal: &ProposalRecord,
) -> Result<Transaction>
pub async fn dao_generic_proposal_tx( &self, proposal: &ProposalRecord, ) -> Result<Transaction>
Create a DAO generic proposal transaction.
Sourcepub async fn dao_vote(
&self,
proposal_bulla: &DaoProposalBulla,
vote_option: bool,
weight: Option<u64>,
) -> Result<Transaction>
pub async fn dao_vote( &self, proposal_bulla: &DaoProposalBulla, vote_option: bool, weight: Option<u64>, ) -> Result<Transaction>
Vote on a DAO proposal
Sourcepub async fn dao_exec_transfer(
&self,
proposal: &ProposalRecord,
early: bool,
) -> Result<Transaction>
pub async fn dao_exec_transfer( &self, proposal: &ProposalRecord, early: bool, ) -> Result<Transaction>
Execute a DAO transfer proposal.
Sourcepub async fn dao_exec_generic(
&self,
proposal: &ProposalRecord,
early: bool,
) -> Result<Transaction>
pub async fn dao_exec_generic( &self, proposal: &ProposalRecord, early: bool, ) -> Result<Transaction>
Execute a DAO generic proposal.
Source§impl Drk
impl Drk
Sourcepub fn initialize_deployooor(&self) -> WalletDbResult<()>
pub fn initialize_deployooor(&self) -> WalletDbResult<()>
Initialize wallet with tables for the Deployooor contract.
Sourcepub async fn deploy_auth_keygen(
&self,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub async fn deploy_auth_keygen( &self, output: &mut Vec<String>, ) -> WalletDbResult<()>
Generate a new deploy authority keypair and place it into the wallet
Sourcepub fn put_deploy_history_record(
&self,
tx_hash: &TransactionHash,
contract: &ContractId,
tx_type: &str,
block_height: &u32,
wasm_bincode: &Option<Vec<u8>>,
deploy_ix: &Option<Vec<u8>>,
) -> WalletDbResult<()>
pub fn put_deploy_history_record( &self, tx_hash: &TransactionHash, contract: &ContractId, tx_type: &str, block_height: &u32, wasm_bincode: &Option<Vec<u8>>, deploy_ix: &Option<Vec<u8>>, ) -> WalletDbResult<()>
Insert a deploy authority history record into the wallet.
Reset all contract deploy authorities locked status in the wallet.
Remove deploy authorities locked status in the wallet that where locked after provided height.
Sourcepub fn reset_deploy_history(
&self,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub fn reset_deploy_history( &self, output: &mut Vec<String>, ) -> WalletDbResult<()>
Reset all contracts history records in the wallet.
Sourcepub fn remove_deploy_history_after(
&self,
height: &u32,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub fn remove_deploy_history_after( &self, height: &u32, output: &mut Vec<String>, ) -> WalletDbResult<()>
Remove the contracts history records in the wallet that were created after provided height.
Sourcepub async fn list_deploy_auth(
&self,
) -> Result<Vec<(ContractId, SecretKey, bool, Option<u32>)>>
pub async fn list_deploy_auth( &self, ) -> Result<Vec<(ContractId, SecretKey, bool, Option<u32>)>>
List contract deploy authorities from the wallet
Sourceasync fn get_deploy_auth(
&self,
contract_id: &ContractId,
) -> Result<(Keypair, bool)>
async fn get_deploy_auth( &self, contract_id: &ContractId, ) -> Result<(Keypair, bool)>
Retrieve a deploy authority keypair and status for provided contract id.
Sourcepub async fn get_deploy_auths_keys_map(
&self,
) -> Result<HashMap<[u8; 32], SecretKey>>
pub async fn get_deploy_auths_keys_map( &self, ) -> Result<HashMap<[u8; 32], SecretKey>>
Retrieve contract deploy authorities keys map from the wallet.
Sourcepub async fn get_deploy_auth_history(
&self,
contract_id: &ContractId,
) -> Result<Vec<(String, String, u32)>>
pub async fn get_deploy_auth_history( &self, contract_id: &ContractId, ) -> Result<Vec<(String, String, u32)>>
Retrieve all deploy history records basic information, for provided contract id.
Sourcepub async fn get_deploy_history_record_data(
&self,
tx_hash: &str,
) -> Result<(Option<Vec<u8>>, Option<Vec<u8>>)>
pub async fn get_deploy_history_record_data( &self, tx_hash: &str, ) -> Result<(Option<Vec<u8>>, Option<Vec<u8>>)>
Retrieve deploy history record WASM bincode and deployed instruction, for provided transaction hash.
Sourcefn apply_deploy_deploy_data(
&self,
scan_cache: &ScanCache,
params: &DeployParamsV1,
tx_hash: &TransactionHash,
block_height: &u32,
) -> Result<bool>
fn apply_deploy_deploy_data( &self, scan_cache: &ScanCache, params: &DeployParamsV1, tx_hash: &TransactionHash, block_height: &u32, ) -> Result<bool>
Auxiliary function to apply DeployFunction::DeployV1 call
data to the wallet.
Returns a flag indicating if the provided call refers to our
own wallet.
Sourceasync fn apply_deploy_lock_data(
&self,
scan_cache: &ScanCache,
public_key: &PublicKey,
tx_hash: &TransactionHash,
lock_height: &u32,
) -> Result<bool>
async fn apply_deploy_lock_data( &self, scan_cache: &ScanCache, public_key: &PublicKey, tx_hash: &TransactionHash, lock_height: &u32, ) -> Result<bool>
Auxiliary function to apply DeployFunction::LockV1 call
data to the wallet.
Returns a flag indicating if the provided call refers to our
own wallet.
Sourcepub async fn apply_tx_deploy_data(
&self,
scan_cache: &mut ScanCache,
data: &[u8],
tx_hash: &TransactionHash,
block_height: &u32,
) -> Result<bool>
pub async fn apply_tx_deploy_data( &self, scan_cache: &mut ScanCache, data: &[u8], tx_hash: &TransactionHash, block_height: &u32, ) -> Result<bool>
Append data related to DeployoOor contract transactions into the wallet database and update the provided scan cache. Returns a flag indicating if provided data refer to our own wallet.
Sourcepub async fn deploy_contract(
&self,
deploy_auth: &ContractId,
wasm_bincode: Vec<u8>,
deploy_ix: Vec<u8>,
) -> Result<Transaction>
pub async fn deploy_contract( &self, deploy_auth: &ContractId, wasm_bincode: Vec<u8>, deploy_ix: Vec<u8>, ) -> Result<Transaction>
Create a feeless contract deployment transaction.
Sourcepub async fn lock_contract(
&self,
deploy_auth: &ContractId,
) -> Result<Transaction>
pub async fn lock_contract( &self, deploy_auth: &ContractId, ) -> Result<Transaction>
Create a feeless contract redeployment lock transaction.
Source§impl Drk
impl Drk
Sourcepub async fn put_tx_history_record(
&self,
tx: &Transaction,
status: &str,
block_height: Option<u32>,
) -> WalletDbResult<String>
pub async fn put_tx_history_record( &self, tx: &Transaction, status: &str, block_height: Option<u32>, ) -> WalletDbResult<String>
Insert or update a Transaction history record into the wallet,
with the provided status, and store its inverse query into the cache.
Sourcepub async fn put_tx_history_records(
&self,
txs: &[&Transaction],
status: &str,
block_height: Option<u32>,
) -> WalletDbResult<Vec<String>>
pub async fn put_tx_history_records( &self, txs: &[&Transaction], status: &str, block_height: Option<u32>, ) -> WalletDbResult<Vec<String>>
Insert or update a slice of Transaction history records into the wallet,
with the provided status.
Sourcepub async fn get_tx_history_record(
&self,
tx_hash: &str,
) -> Result<(String, String, Option<u32>, Transaction)>
pub async fn get_tx_history_record( &self, tx_hash: &str, ) -> Result<(String, String, Option<u32>, Transaction)>
Get a transaction history record.
Sourcepub fn get_txs_history(
&self,
) -> WalletDbResult<Vec<(String, String, Option<u32>)>>
pub fn get_txs_history( &self, ) -> WalletDbResult<Vec<(String, String, Option<u32>)>>
Fetch all transactions history records, excluding bytes column.
Sourcepub fn reset_tx_history(&self, output: &mut Vec<String>) -> WalletDbResult<()>
pub fn reset_tx_history(&self, output: &mut Vec<String>) -> WalletDbResult<()>
Reset the transaction history records in the wallet.
Sourcepub fn revert_transactions_after(
&self,
height: &u32,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub fn revert_transactions_after( &self, height: &u32, output: &mut Vec<String>, ) -> WalletDbResult<()>
Set reverted status to the transaction history records in the wallet that where executed after provided height.
Sourcepub fn remove_reverted_txs(
&self,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub fn remove_reverted_txs( &self, output: &mut Vec<String>, ) -> WalletDbResult<()>
Remove the transaction history records in the wallet that have been reverted.
Source§impl Drk
impl Drk
Sourcepub fn get_scanned_block_hash(&self, height: &u32) -> WalletDbResult<String>
pub fn get_scanned_block_hash(&self, height: &u32) -> WalletDbResult<String>
Get a scanned block information record.
Sourcepub fn get_scanned_block_records(&self) -> WalletDbResult<Vec<(u32, String)>>
pub fn get_scanned_block_records(&self) -> WalletDbResult<Vec<(u32, String)>>
Fetch all scanned block information records.
Sourcepub fn get_last_scanned_block(&self) -> WalletDbResult<(u32, String)>
pub fn get_last_scanned_block(&self) -> WalletDbResult<(u32, String)>
Get the last scanned block height and hash from the wallet. If database is empty default (0, ‘-’) is returned.
Sourcepub fn reset_scanned_blocks(
&self,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub fn reset_scanned_blocks( &self, output: &mut Vec<String>, ) -> WalletDbResult<()>
Reset the scanned blocks information records in the cache.
Sourcepub async fn reset_to_height(
&self,
height: u32,
output: &mut Vec<String>,
) -> WalletDbResult<()>
pub async fn reset_to_height( &self, height: u32, output: &mut Vec<String>, ) -> WalletDbResult<()>
Reset state to provided block height. If genesis block height(0) was provided, perform a full reset.
Source§impl Drk
impl Drk
Auto Trait Implementations§
impl !Freeze for Drk
impl !RefUnwindSafe for Drk
impl Send for Drk
impl Sync for Drk
impl !Unpin for Drk
impl !UnwindSafe for Drk
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Pointee for T
impl<T> Pointee for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.