pub struct Drk {
pub rpc_client: RpcClient,
}
Fields§
§rpc_client: RpcClient
Implementations§
source§impl Drk
impl Drk
sourcepub async fn init_swap(
&self,
value_send: u64,
token_send: TokenId,
value_recv: u64,
token_recv: TokenId
) -> Result<PartialSwapData>
pub async fn init_swap( &self, value_send: u64, token_send: TokenId, value_recv: u64, token_recv: TokenId ) -> Result<PartialSwapData>
Initialize the first half of an atomic swap
sourcepub async fn join_swap(&self, partial: PartialSwapData) -> Result<Transaction>
pub async fn join_swap(&self, partial: PartialSwapData) -> 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>) -> Result<()>
pub async fn inspect_swap(&self, bytes: Vec<u8>) -> 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 a given transaction by retrieving the secret key from the encrypted note and prepending it to the transaction’s signatures.
source§impl Drk
impl Drk
sourcepub async fn dao_mint(&self, dao_id: u64) -> Result<Transaction>
pub async fn dao_mint(&self, dao_id: u64) -> Result<Transaction>
Mint a DAO on-chain
sourcepub async fn dao_propose(
&self,
dao_id: u64,
recipient: PublicKey,
amount: u64,
token_id: TokenId
) -> Result<Transaction>
pub async fn dao_propose( &self, dao_id: u64, recipient: PublicKey, amount: u64, token_id: TokenId ) -> Result<Transaction>
Create a DAO proposal
sourcepub async fn dao_vote(
&self,
dao_id: u64,
proposal_id: u64,
vote_option: bool,
weight: u64
) -> Result<Transaction>
pub async fn dao_vote( &self, dao_id: u64, proposal_id: u64, vote_option: bool, weight: u64 ) -> Result<Transaction>
Vote on a DAO proposal
sourcepub async fn dao_exec(
&self,
dao: Dao,
proposal: DaoProposal
) -> Result<Transaction>
pub async fn dao_exec( &self, dao: Dao, proposal: DaoProposal ) -> Result<Transaction>
Import given DAO votes into the wallet This function is really bad but I’m also really tired and annoyed.
source§impl Drk
impl Drk
sourcepub async fn mint_token(
&self,
amount: &str,
recipient: PublicKey,
token_id: TokenId
) -> Result<Transaction>
pub async fn mint_token( &self, amount: &str, recipient: PublicKey, token_id: TokenId ) -> 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 subscribe_blocks(&self, endpoint: Url) -> Result<()>
pub async fn subscribe_blocks(&self, endpoint: Url) -> Result<()>
Subscribes to darkfid’s JSON-RPC notification endpoint that serves new finalized blocks. Upon receiving them, all the transactions are scanned and we check if any of them call the money contract, and if the payments are intended for us. If so, we decrypt them and append the metadata to our wallet.
sourceasync fn scan_block_dao(&self, block: &BlockInfo) -> Result<()>
async fn scan_block_dao(&self, block: &BlockInfo) -> Result<()>
scan_block_dao
will go over transactions in a block and fetch the ones dealing
with the dao contract. Then over all of them, try to see if any are related
to us. If any are found, the metadata is extracted and placed into the wallet
for future use.
sourceasync fn scan_block_money(&self, block: &BlockInfo) -> Result<()>
async fn scan_block_money(&self, block: &BlockInfo) -> Result<()>
scan_block_money
will go over transactions in a block and fetch the ones dealing
with the money contract. Then over all of them, try to see if any are related
to us. If any are found, the metadata is extracted and placed into the wallet
for future use.
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 broadcast_tx(&self, tx: &Transaction) -> Result<String>
pub async fn broadcast_tx(&self, tx: &Transaction) -> Result<String>
Broadcast a given transaction to darkfid and forward onto the network. Returns the transaction ID upon success
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
sourceasync fn get_block_by_slot(&self, slot: u64) -> Result<Option<BlockInfo>>
async fn get_block_by_slot(&self, slot: u64) -> Result<Option<BlockInfo>>
Queries darkfid for a block with given slot
sourcepub async fn get_tx(&self, tx_hash: &Hash) -> Result<Option<Transaction>>
pub async fn get_tx(&self, tx_hash: &Hash) -> Result<Option<Transaction>>
Queries darkfid for a tx with given hash
sourcepub async fn scan_blocks(&self, reset: bool) -> Result<()>
pub async fn scan_blocks(&self, reset: bool) -> Result<()>
Scans the blockchain starting from the last scanned slot, for relevant money transfer transactions. If reset flag is provided, Merkle tree state and coins are reset, and start scanning from beginning. Alternatively, it looks for a checkpoint in the wallet to reset and start scanning from.
sourcepub async fn subscribe_err_txs(&self, endpoint: Url) -> Result<()>
pub async fn subscribe_err_txs(&self, endpoint: Url) -> Result<()>
Subscribes to darkfid’s JSON-RPC notification endpoint that serves erroneous transactions rejections.
source§impl Drk
impl Drk
sourcepub async fn initialize_wallet(&self) -> Result<()>
pub async fn initialize_wallet(&self) -> Result<()>
Initialize wallet with tables for drk
source§impl Drk
impl Drk
sourcepub async fn initialize_dao(&self) -> Result<()>
pub async fn initialize_dao(&self) -> Result<()>
Initialize wallet with tables for the DAO contract
sourcepub async fn get_dao_secrets(&self) -> Result<Vec<SecretKey>>
pub async fn get_dao_secrets(&self) -> Result<Vec<SecretKey>>
Fetch all DAO secret keys from the wallet
sourcepub async fn put_dao_trees(
&self,
daos_tree: &MerkleTree,
proposals_tree: &MerkleTree
) -> Result<()>
pub async fn put_dao_trees( &self, daos_tree: &MerkleTree, proposals_tree: &MerkleTree ) -> Result<()>
Replace the DAO Merkle trees in the wallet.
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
sourcepub async fn reset_dao_trees(&self) -> Result<()>
pub async fn reset_dao_trees(&self) -> Result<()>
Reset the DAO Merkle trees in the wallet
sourcepub async fn reset_daos(&self) -> Result<()>
pub async fn reset_daos(&self) -> Result<()>
Reset confirmed DAOs in the wallet
pub async fn reset_dao_proposals(&self) -> Result<()>
pub async fn reset_dao_votes(&self) -> Result<()>
pub async fn get_dao_id_by_alias(&self, alias_filter: &str) -> Result<u64>
sourcepub async fn get_dao_id(&self, alias: &str) -> Result<u64>
pub async fn get_dao_id(&self, alias: &str) -> Result<u64>
Convenience function. Interprets the alias either as the DAO alias or its ID
sourcepub async fn import_dao(
&self,
dao_name: String,
dao_params: DaoParams
) -> Result<()>
pub async fn import_dao( &self, dao_name: String, dao_params: DaoParams ) -> Result<()>
Import given DAO params into the wallet with a given name.
sourcepub async fn dao_list(&self, dao_id: Option<u64>) -> Result<()>
pub async fn dao_list(&self, dao_id: Option<u64>) -> Result<()>
List DAO(s) imported in the wallet. If an ID is given, just print the metadata for that specific one, if found.
async fn dao_list_single(&self, dao_id: u64) -> Result<()>
sourcepub async fn get_dao_by_id(&self, dao_id: u64) -> Result<Dao>
pub async fn get_dao_by_id(&self, dao_id: u64) -> Result<Dao>
Fetch a DAO given a numeric ID
sourcepub async fn dao_balance(&self, dao_id: u64) -> Result<HashMap<String, u64>>
pub async fn dao_balance(&self, dao_id: u64) -> Result<HashMap<String, u64>>
Fetch known unspent balances from the wallet for the given DAO ID
sourcepub async fn get_dao_proposals(&self, dao_id: u64) -> Result<Vec<DaoProposal>>
pub async fn get_dao_proposals(&self, dao_id: u64) -> Result<Vec<DaoProposal>>
Fetch all known DAO proposals from the wallet given a DAO ID
sourcepub async fn get_dao_proposal_by_id(
&self,
proposal_id: u64
) -> Result<DaoProposal>
pub async fn get_dao_proposal_by_id( &self, proposal_id: u64 ) -> Result<DaoProposal>
Fetch a DAO proposal by its ID
pub async fn get_dao_proposal_votes( &self, proposal_id: u64 ) -> Result<Vec<DaoVote>>
sourcepub async fn apply_tx_dao_data(
&self,
tx: &Transaction,
confirm: bool
) -> Result<()>
pub async fn apply_tx_dao_data( &self, tx: &Transaction, confirm: bool ) -> Result<()>
Append data related to DAO contract transactions into the wallet database.
Optionally, if confirm
is true, also append the data in the Merkle trees, etc.
sourcepub async fn confirm_daos(&self, daos: &[Dao]) -> Result<()>
pub async fn confirm_daos(&self, daos: &[Dao]) -> Result<()>
Confirm already imported DAO metadata into the wallet. Here we just write the leaf position, tx hash, and call index. Panics if the fields are None.
sourcepub async fn unconfirm_daos(&self, daos: &[Dao]) -> Result<()>
pub async fn unconfirm_daos(&self, daos: &[Dao]) -> Result<()>
Unconfirm imported DAOs by removing the leaf position, txid, and call index.
sourcepub async fn put_dao_proposals(&self, proposals: &[DaoProposal]) -> Result<()>
pub async fn put_dao_proposals(&self, proposals: &[DaoProposal]) -> Result<()>
Import given DAO proposals into the wallet
sourcepub async fn put_dao_votes(&self, votes: &[DaoVote]) -> Result<()>
pub async fn put_dao_votes(&self, votes: &[DaoVote]) -> Result<()>
Import given DAO votes into the wallet
source§impl Drk
impl Drk
sourcepub async fn initialize_money(&self) -> Result<()>
pub async fn initialize_money(&self) -> Result<()>
Initialize wallet with tables for the Money contract
sourcepub async fn money_keygen(&self) -> Result<()>
pub async fn money_keygen(&self) -> Result<()>
Generate a new keypair and place it into 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>
) -> Result<Vec<PublicKey>>
pub async fn import_money_secrets( &self, secrets: Vec<SecretKey> ) -> Result<Vec<PublicKey>>
Import given secret keys into the wallet. The query uses INSERT, so if the key already exists, it will be skipped. Returns the respective PublicKey objects for the imported keys.
sourcepub async fn wallet_address(&self, idx: u64) -> Result<PublicKey>
pub async fn wallet_address(&self, idx: u64) -> Result<PublicKey>
Fetch pubkeys from the wallet and return the requested index.
sourcepub async fn get_coins(&self, fetch_spent: bool) -> Result<Vec<(OwnCoin, bool)>>
pub async fn get_coins(&self, fetch_spent: bool) -> Result<Vec<(OwnCoin, bool)>>
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.
sourcepub async fn mark_spent_coin(&self, coin: &Coin) -> Result<()>
pub async fn mark_spent_coin(&self, coin: &Coin) -> Result<()>
Mark a coin in the wallet as spent
sourcepub async fn mark_spent_coins(&self, nullifiers: &[Nullifier]) -> Result<()>
pub async fn mark_spent_coins(&self, nullifiers: &[Nullifier]) -> Result<()>
Marks all coins in the wallet as spent, if their nullifier is in the given set
sourcepub async fn unspend_coin(&self, coin: &Coin) -> Result<()>
pub async fn unspend_coin(&self, coin: &Coin) -> Result<()>
Mark a given coin in the wallet as unspent
sourcepub async fn put_money_tree(&self, tree: &MerkleTree) -> Result<()>
pub async fn put_money_tree(&self, tree: &MerkleTree) -> Result<()>
Replace the Money Merkle tree in the wallet.
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 wallet
sourcepub async fn reset_money_tree(&self) -> Result<()>
pub async fn reset_money_tree(&self) -> Result<()>
Reset the Money Merkle tree in the wallet
sourcepub async fn reset_money_coins(&self) -> Result<()>
pub async fn reset_money_coins(&self) -> Result<()>
Reset the Money coins in the wallet
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 apply_tx_money_data(
&self,
tx: &Transaction,
_confirm: bool
) -> Result<()>
pub async fn apply_tx_money_data( &self, tx: &Transaction, _confirm: bool ) -> Result<()>
Append data related to Money contract transactions into the wallet database.
sourcepub async fn last_scanned_slot(&self) -> Result<u64>
pub async fn last_scanned_slot(&self) -> Result<u64>
Get the last scanned slot from the wallet
sourcepub async fn add_alias(&self, alias: String, token_id: TokenId) -> Result<()>
pub async fn add_alias(&self, alias: String, token_id: TokenId) -> Result<()>
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 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 remove_alias(&self, alias: String) -> Result<()>
pub async fn remove_alias(&self, alias: String) -> Result<()>
Create an alias record for provided Token ID
source§impl Drk
impl Drk
sourcepub async fn get_txs_history(&self) -> Result<Vec<(String, String)>>
pub async fn get_txs_history(&self) -> Result<Vec<(String, String)>>
Fetch all transactions history records, excluding bytes column.
sourcepub async fn get_tx_history_record(
&self,
tx_hash: &str
) -> Result<(String, String, Transaction)>
pub async fn get_tx_history_record( &self, tx_hash: &str ) -> Result<(String, String, Transaction)>
Get a transaction history record.
sourcepub async fn insert_tx_history_record(&self, tx: &Transaction) -> Result<()>
pub async fn insert_tx_history_record(&self, tx: &Transaction) -> Result<()>
Insert a Transaction
history record into the wallet.
sourcepub async fn update_tx_history_record_status(
&self,
tx_hash: &str,
status: &str
) -> Result<()>
pub async fn update_tx_history_record_status( &self, tx_hash: &str, status: &str ) -> Result<()>
Update a transactions history record status to the given one.
sourcepub async fn update_tx_history_records_status(
&self,
txs: &Vec<Transaction>,
status: &str
) -> Result<()>
pub async fn update_tx_history_records_status( &self, txs: &Vec<Transaction>, status: &str ) -> Result<()>
Update given transactions history record statuses to the given one.
sourcepub async fn update_all_tx_history_records_status(
&self,
status: &str
) -> Result<()>
pub async fn update_all_tx_history_records_status( &self, status: &str ) -> Result<()>
Update all transaction history records statuses to the given one.
Auto Trait Implementations§
impl RefUnwindSafe for Drk
impl Send for Drk
impl Sync for Drk
impl Unpin for Drk
impl UnwindSafe for Drk
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§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.source§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.source§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.source§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.source§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.source§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.source§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.source§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.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere Self: Sized,
source§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 moresource§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 moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere Self: Borrow<B>, B: 'a + ?Sized, R: 'a,
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> Rwhere Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere Self: AsRef<U>, U: 'a + ?Sized, R: 'a,
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere Self: AsMut<U>, U: 'a + ?Sized, R: 'a,
self
, then passes self.as_mut()
into the pipe
function.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere Self: Deref<Target = T>, T: ?Sized,
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,
Deref::Target
of a value. Read moresource§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.source§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.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, B: ?Sized,
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere Self: AsRef<R>, R: ?Sized,
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere Self: AsMut<R>, R: ?Sized,
.tap_ref_mut()
only in debug builds, and is erased in release
builds.