Struct drk::Drk

source ·
pub struct Drk {
    pub wallet: Arc<WalletDb>,
    pub rpc_client: Option<RpcClient>,
}
Expand description

CLI-util structure

Fields§

§wallet: Arc<WalletDb>

Wallet database operations handler

§rpc_client: Option<RpcClient>

JSON-RPC client to execute requests to darkfid daemon

Implementations§

source§

impl Drk

source

pub async fn subscribe_blocks( &self, endpoint: Url, ex: Arc<Executor<'static>> ) -> 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.

source

async fn scan_block(&self, block: &BlockInfo) -> Result<()>

scan_block will go over over transactions in a block and handle their calls based on the called contract. Additionally, will update last_scanned_block to the probided block height.

source

pub async fn scan_blocks(&self, reset: bool) -> Result<(), WalletDbError>

Scans the blockchain starting from the last scanned block, 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.

source

async fn get_block_by_height(&self, height: u32) -> Result<BlockInfo>

source

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.

source

pub async fn get_tx( &self, tx_hash: &TransactionHash ) -> Result<Option<Transaction>>

Queries darkfid for a tx with given hash.

source

pub async fn simulate_tx(&self, tx: &Transaction) -> Result<bool>

Simulate the transaction with the state machine.

source

pub async fn lookup_zkas( &self, contract_id: &ContractId ) -> Result<Vec<(String, Vec<u8>)>>

Try to fetch zkas bincodes for the given ContractId.

source

pub async fn get_tx_gas( &self, tx: &Transaction, include_fee: bool ) -> Result<u64>

Queries darkfid for given transaction’s gas.

source§

impl Drk

source

pub async fn transfer( &self, amount: &str, token_id: TokenId, recipient: PublicKey ) -> Result<Transaction>

Create a payment transaction. Returns the transaction object on success.

source§

impl Drk

source

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

source

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.

source

pub async fn inspect_swap(&self, bytes: Vec<u8>) -> Result<()>

Inspect and verify a given swap (half or full) transaction

source

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

source

fn derive_token_attributes( &self, mint_authority: SecretKey, token_blind: BaseBlind ) -> TokenAttributes

Auxiliary function to derive TokenAttributes for provided secret key and token blind.

source

pub async fn import_mint_authority( &self, mint_authority: SecretKey, token_blind: BaseBlind ) -> Result<TokenId>

Import a token mint authority into the wallet.

source

async fn parse_mint_authority_record( &self, row: &[Value] ) -> Result<(TokenId, SecretKey, BaseBlind, bool)>

Auxiliary function to parse a MONEY_TOKENS_TABLE records. The boolean in the returned tuples notes if the token mint authority is frozen.

source

pub async fn get_mint_authorities( &self ) -> Result<Vec<(TokenId, SecretKey, BaseBlind, bool)>>

Fetch all token mint authorities from the wallet.

source

async fn get_token_mint_authority( &self, token_id: &TokenId ) -> Result<(TokenId, SecretKey, BaseBlind, bool)>

Fetch provided token unfrozen mint authority from the wallet.

source

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.

source

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

source

pub async fn initialize_money(&self) -> Result<(), WalletDbError>

Initialize wallet with tables for the Money contract.

source

pub async fn money_keygen(&self) -> Result<(), WalletDbError>

Generate a new keypair and place it into the wallet.

source

pub async fn default_secret(&self) -> Result<SecretKey>

Fetch default secret key from the wallet.

source

pub async fn default_address(&self) -> Result<PublicKey>

Fetch default pubkey from the wallet.

source

pub async fn set_default_address(&self, idx: usize) -> Result<(), WalletDbError>

Set provided index address as default in the wallet.

source

pub async fn addresses(&self) -> Result<Vec<(u64, PublicKey, SecretKey, u64)>>

Fetch all pukeys from the wallet.

source

pub async fn get_money_secrets(&self) -> Result<Vec<SecretKey>>

Fetch all secret keys from the wallet.

source

pub async fn import_money_secrets( &self, secrets: Vec<SecretKey> ) -> 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.

source

pub async fn money_balance(&self) -> Result<HashMap<String, u64>>

Fetch known unspent balances from the wallet and return them as a hashmap.

source

pub async fn get_coins( &self, fetch_spent: bool ) -> Result<Vec<(OwnCoin, bool, 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.

source

pub async fn get_token_coins(&self, token_id: &TokenId) -> Result<Vec<OwnCoin>>

Fetch provided token unspend balances from the wallet.

source

async fn parse_coin_record( &self, row: &[Value] ) -> Result<(OwnCoin, bool, String)>

Auxiliary function to parse a MONEY_COINS_TABLE record. The boolean in the returned tuple notes if the coin was marked as spent.

source

pub async fn add_alias( &self, alias: String, token_id: TokenId ) -> Result<(), WalletDbError>

Create an alias record for provided Token ID.

source

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.

source

pub async fn get_aliases_mapped_by_token( &self ) -> Result<HashMap<String, String>>

Fetch all aliases from the wallet, mapped by token id.

source

pub async fn remove_alias(&self, alias: String) -> Result<(), WalletDbError>

Remove provided alias record from the wallet database.

source

pub async fn unspend_coin(&self, coin: &Coin) -> Result<(), WalletDbError>

Mark a given coin in the wallet as unspent.

source

pub async fn put_money_tree( &self, tree: &MerkleTree ) -> Result<(), WalletDbError>

Replace the Money Merkle tree in the wallet.

source

pub async fn get_money_tree(&self) -> Result<MerkleTree>

Fetch the Money Merkle tree from the wallet.

source

pub async fn last_scanned_block(&self) -> Result<u32, WalletDbError>

Get the last scanned block height from the wallet.

source

async fn parse_money_call( &self, call_idx: usize, calls: &[DarkLeaf<ContractCall>] ) -> Result<(Vec<Nullifier>, Vec<Coin>, Vec<AeadEncryptedNote>, Vec<TokenId>)>

Auxiliary function to grab all the nullifiers, coins, notes and freezes from a transaction money call.

source

pub async fn apply_tx_money_data( &self, call_idx: usize, calls: &[DarkLeaf<ContractCall>], tx_hash: &String ) -> Result<()>

Append data related to Money contract transactions into the wallet database.

source

async fn money_call_nullifiers( &self, call: &DarkLeaf<ContractCall> ) -> Result<Vec<Nullifier>>

Auxiliary function to grab all the nullifiers from a transaction money call.

source

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

Mark provided transaction input coins as spent.

source

pub async fn mark_spent_coin( &self, coin: &Coin, spent_tx_hash: &String ) -> Result<(), WalletDbError>

Mark a coin in the wallet as spent

source

pub async fn mark_spent_coins( &self, nullifiers: &[Nullifier], spent_tx_hash: &String ) -> Result<()>

Marks all coins in the wallet as spent, if their nullifier is in the given set

source

pub async fn reset_money_tree(&self) -> Result<(), WalletDbError>

Reset the Money Merkle tree in the wallet

source

pub async fn reset_money_coins(&self) -> Result<(), WalletDbError>

Reset the Money coins in the wallet

source

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.

source

pub async fn append_fee_call( &self, tx: &Transaction, public_key: PublicKey, 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.

source

pub async fn attach_fee(&self, tx: &mut Transaction) -> Result<()>

Create and attach the fee call to given transaction.

source§

impl Drk

source

pub async fn initialize_dao(&self) -> Result<(), WalletDbError>

Initialize wallet with tables for the DAO contract.

source

pub async fn put_dao_trees( &self, daos_tree: &MerkleTree, proposals_tree: &MerkleTree ) -> Result<(), WalletDbError>

Replace the DAO Merkle trees in the wallet.

source

pub async fn get_dao_trees(&self) -> Result<(MerkleTree, MerkleTree)>

Fetch DAO Merkle trees from the wallet.

source

pub async fn get_dao_secrets(&self) -> Result<Vec<SecretKey>>

Fetch all DAO secret keys from the wallet.

source

pub async fn get_daos(&self) -> Result<Vec<Dao>>

Fetch all known DAOs from the wallet.

source

async fn parse_dao_proposal( &self, dao: &Dao, row: &[Value] ) -> Result<DaoProposal>

Auxiliary function to parse a proposal record row.

source

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.

source

pub async fn apply_tx_dao_data( &self, data: &[u8], tx_hash: TransactionHash, call_idx: u8, 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.

source

pub async fn confirm_daos(&self, daos: &[Dao]) -> Result<(), WalletDbError>

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.

source

pub async fn unconfirm_daos(&self, daos: &[Dao]) -> Result<(), WalletDbError>

Unconfirm imported DAOs by removing the leaf position, txid, and call index.

source

pub async fn put_dao_proposals(&self, proposals: &[DaoProposal]) -> Result<()>

Import given DAO proposals into the wallet.

source

pub async fn put_dao_votes( &self, votes: &[DaoVote] ) -> Result<(), WalletDbError>

Import given DAO votes into the wallet.

source

pub async fn reset_dao_trees(&self) -> Result<(), WalletDbError>

Reset the DAO Merkle trees in the wallet.

source

pub async fn reset_daos(&self) -> Result<(), WalletDbError>

Reset confirmed DAOs in the wallet.

source

pub async fn reset_dao_proposals(&self) -> Result<(), WalletDbError>

Reset all DAO proposals in the wallet.

source

pub async fn reset_dao_votes(&self) -> Result<(), WalletDbError>

Reset all DAO votes in the wallet.

source

pub async fn import_dao( &self, dao_name: String, dao_params: DaoParams ) -> Result<()>

Import given DAO params into the wallet with a given name.

source

pub async fn get_dao_id_by_alias(&self, alias_filter: &str) -> Result<u64>

Retrieve DAO ID using provided alias filter.

source

pub async fn get_dao_id(&self, alias: &str) -> Result<u64>

Convenience function. Interprets the alias either as the DAO alias or its ID.

source

pub async fn get_dao_by_id(&self, dao_id: u64) -> Result<Dao>

Fetch a DAO given a numeric ID.

source

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.

source

async fn dao_list_single(&self, dao_id: u64) -> Result<()>

Retrieve DAO for provided ID and print its metadata.

source

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

source

pub async fn get_dao_proposal_by_id( &self, proposal_id: u64 ) -> Result<DaoProposal>

Fetch a DAO proposal by its ID

source

pub async fn get_dao_proposal_votes( &self, proposal_id: u64 ) -> Result<Vec<DaoVote>>

source

pub async fn dao_mint(&self, dao_id: u64) -> Result<Transaction>

Mint a DAO on-chain

source

pub async fn dao_propose( &self, dao_id: u64, _recipient: PublicKey, amount: u64, token_id: TokenId ) -> Result<Transaction>

Create a DAO proposal

source

pub async fn dao_vote( &self, dao_id: u64, proposal_id: u64, vote_option: bool, weight: u64 ) -> Result<Transaction>

Vote on a DAO proposal

source

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

source

pub async fn initialize_deployooor(&self) -> Result<(), WalletDbError>

Initialize wallet with tables for the Deployooor contract.

source

pub async fn deploy_auth_keygen(&self) -> Result<(), WalletDbError>

Generate a new deploy authority keypair and place it into the wallet

source

pub async fn list_deploy_auth(&self) -> Result<Vec<(i64, ContractId, bool)>>

List contract deploy authorities from the wallet

source

async fn get_deploy_auth(&self, idx: u64) -> Result<Keypair>

Retrieve a deploy authority keypair given an index

source

pub async fn deploy_contract( &self, deploy_auth: u64, wasm_bincode: Vec<u8>, deploy_ix: Vec<u8> ) -> Result<Transaction>

Create a feeless contract deployment transaction.

source

pub async fn lock_contract(&self, deploy_auth: u64) -> Result<Transaction>

Create a feeless contract redeployment lock transaction.

source§

impl Drk

source

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

Insert a Transaction history record into the wallet.

source

pub async fn insert_tx_history_records( &self, txs: &[Transaction] ) -> Result<Vec<String>, WalletDbError>

Insert a slice of [Transaction] history records into the wallet.

source

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

Get a transaction history record.

source

pub async fn get_txs_history( &self ) -> Result<Vec<(String, String)>, WalletDbError>

Fetch all transactions history records, excluding bytes column.

source

pub async fn update_tx_history_records_status( &self, txs_hashes: &[String], status: &str ) -> Result<(), WalletDbError>

Update given transactions history record statuses to the given one.

source

pub async fn update_all_tx_history_records_status( &self, status: &str ) -> Result<(), WalletDbError>

Update all transaction history records statuses to the given one.

source§

impl Drk

source

pub(crate) async fn new( wallet_path: String, wallet_pass: String, endpoint: Option<Url>, ex: Arc<Executor<'static>> ) -> Result<Self>

source

pub(crate) async fn initialize_wallet(&self) -> Result<()>

Initialize wallet with tables for drk

source

pub(crate) async fn ping(&self) -> Result<()>

Auxiliary function to ping configured darkfid daemon for liveness.

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§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

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
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

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

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

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.

§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
§

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

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows 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) -> R
where R: 'a,

Mutably borrows 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
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows 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
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows 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
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .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
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .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
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

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

§

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>,

§

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

impl<T> Upcastable for T
where T: Any + Send + Sync + 'static,

§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

upcast boxed dyn
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,