Bank

Struct Bank 

Source
pub struct Bank {
Show 14 fields pub rc: BankRc, pub src: StatusCacheRc, pub ancestors: Ancestors, pub ns_per_slot: u128, pub last_vote_sync: AtomicU64, pub rewards: RwLock<Vec<(Pubkey, RewardInfo)>>, pub cluster_type: Option<ClusterType>, pub lazy_rent_collection: AtomicBool, pub rewards_pool_pubkeys: Arc<HashSet<Pubkey>>, pub transaction_log_collector_config: Arc<RwLock<TransactionLogCollectorConfig>>, pub transaction_log_collector: Arc<RwLock<TransactionLogCollector>>, pub feature_set: Arc<FeatureSet>, pub drop_callback: RwLock<OptionalDropCallback>, pub freeze_started: AtomicBool, /* private fields */
}
Expand description

Manager for the state of all accounts and programs after processing its entries. AbiExample is needed even without Serialize/Deserialize; actual (de-)serialization are implemented elsewhere for versioning

Fields§

§rc: BankRc

References to accounts, parent and signature status

§src: StatusCacheRc§ancestors: Ancestors

The set of parents including this bank

§ns_per_slot: u128

length of a slot in ns

§last_vote_sync: AtomicU64

Last time when the cluster info vote listener has synced with this bank

§rewards: RwLock<Vec<(Pubkey, RewardInfo)>>

Protocol-level rewards that were distributed by this bank

§cluster_type: Option<ClusterType>§lazy_rent_collection: AtomicBool§rewards_pool_pubkeys: Arc<HashSet<Pubkey>>§transaction_log_collector_config: Arc<RwLock<TransactionLogCollectorConfig>>§transaction_log_collector: Arc<RwLock<TransactionLogCollector>>§feature_set: Arc<FeatureSet>§drop_callback: RwLock<OptionalDropCallback>§freeze_started: AtomicBool

Implementations§

Source§

impl Bank

Source

pub fn default_for_tests() -> Self

Source

pub fn new_for_benches(genesis_config: &GenesisConfig) -> Self

Source

pub fn new_for_tests(genesis_config: &GenesisConfig) -> Self

Source

pub fn new_no_wallclock_throttle_for_tests( genesis_config: &GenesisConfig, ) -> Self

Source

pub fn new_with_paths_for_tests( genesis_config: &GenesisConfig, paths: Vec<PathBuf>, frozen_account_pubkeys: &[Pubkey], debug_keys: Option<Arc<HashSet<Pubkey>>>, additional_builtins: Option<&Builtins>, account_indexes: AccountSecondaryIndexes, accounts_db_caching_enabled: bool, shrink_ratio: AccountShrinkThreshold, debug_do_not_add_builtins: bool, ) -> Self

Source

pub fn new_with_paths_for_benches( genesis_config: &GenesisConfig, paths: Vec<PathBuf>, frozen_account_pubkeys: &[Pubkey], debug_keys: Option<Arc<HashSet<Pubkey>>>, additional_builtins: Option<&Builtins>, account_indexes: AccountSecondaryIndexes, accounts_db_caching_enabled: bool, shrink_ratio: AccountShrinkThreshold, debug_do_not_add_builtins: bool, ) -> Self

Source

pub fn new_with_paths( genesis_config: &GenesisConfig, paths: Vec<PathBuf>, frozen_account_pubkeys: &[Pubkey], debug_keys: Option<Arc<HashSet<Pubkey>>>, additional_builtins: Option<&Builtins>, account_indexes: AccountSecondaryIndexes, accounts_db_caching_enabled: bool, shrink_ratio: AccountShrinkThreshold, debug_do_not_add_builtins: bool, accounts_db_config: Option<AccountsDbConfig>, ) -> Self

Source

pub fn new_from_parent( parent: &Arc<Bank>, collector_id: &Pubkey, slot: Slot, ) -> Self

Create a new bank that points to an immutable checkpoint of another bank.

Source

pub fn new_from_parent_with_vote_only( parent: &Arc<Bank>, collector_id: &Pubkey, slot: Slot, vote_only_bank: bool, ) -> Self

Source

pub fn new_from_parent_with_tracer( parent: &Arc<Bank>, collector_id: &Pubkey, slot: Slot, reward_calc_tracer: impl FnMut(&RewardCalculationEvent<'_, '_>), ) -> Self

Source

pub fn set_callback( &self, callback: Option<Box<dyn DropCallback + Send + Sync>>, )

Source

pub fn vote_only_bank(&self) -> bool

Source

pub fn warp_from_parent( parent: &Arc<Bank>, collector_id: &Pubkey, slot: Slot, ) -> Self

Like new_from_parent but additionally:

  • Doesn’t assume that the parent is anywhere near slot, parent could be millions of slots in the past
  • Adjusts the new bank’s tick height to avoid having to run PoH for millions of slots
  • Freezes the new bank, assuming that the user will Bank::new_from_parent from this bank
Source

pub fn collector_id(&self) -> &Pubkey

Source

pub fn genesis_creation_time(&self) -> UnixTimestamp

Source

pub fn slot(&self) -> Slot

Source

pub fn bank_id(&self) -> BankId

Source

pub fn epoch(&self) -> Epoch

Source

pub fn first_normal_epoch(&self) -> Epoch

Source

pub fn freeze_lock(&self) -> RwLockReadGuard<'_, Hash>

Source

pub fn hash(&self) -> Hash

Source

pub fn is_frozen(&self) -> bool

Source

pub fn freeze_started(&self) -> bool

Source

pub fn status_cache_ancestors(&self) -> Vec<u64>

Source

pub fn unix_timestamp_from_genesis(&self) -> i64

computed unix_timestamp at this slot height

Source

pub fn get_unused_from_slot(rooted_slot: Slot, unused: u64) -> u64

Unused conversion

Source

pub fn clock(&self) -> Clock

Source

pub fn get_slot_history(&self) -> SlotHistory

Source

pub fn epoch_duration_in_years(&self, prev_epoch: Epoch) -> f64

Source

pub fn slot_in_year_for_inflation(&self) -> f64

Source

pub fn update_recent_blockhashes(&self)

Source

pub fn rehash(&self)

Source

pub fn freeze(&self)

Source

pub fn exhaustively_free_unused_resource( &self, last_full_snapshot_slot: Option<Slot>, )

Source

pub fn epoch_schedule(&self) -> &EpochSchedule

Source

pub fn squash(&self)

squash the parent’s state up into this Bank, this Bank becomes a root

Source

pub fn parent(&self) -> Option<Arc<Bank>>

Return the more recent checkpoint of this bank instance.

Source

pub fn parent_slot(&self) -> Slot

Source

pub fn parent_hash(&self) -> Hash

Source

pub fn add_native_program( &self, name: &str, program_id: &Pubkey, must_replace: bool, )

Source

pub fn set_rent_burn_percentage(&mut self, burn_percent: u8)

Source

pub fn set_hashes_per_tick(&mut self, hashes_per_tick: Option<u64>)

Source

pub fn last_blockhash(&self) -> Hash

Return the last block hash registered.

Source

pub fn is_blockhash_valid(&self, hash: &Hash) -> bool

Source

pub fn get_minimum_balance_for_rent_exemption(&self, data_len: usize) -> u64

Source

pub fn last_blockhash_with_fee_calculator(&self) -> (Hash, FeeCalculator)

👎Deprecated since 1.8.0: Please use last_blockhash and get_fee_for_message instead
Source

pub fn get_fee_calculator(&self, hash: &Hash) -> Option<FeeCalculator>

👎Deprecated since 1.8.0: Please use get_fee_for_message instead
Source

pub fn get_fee_rate_governor(&self) -> &FeeRateGovernor

👎Deprecated since 1.8.0: Please use get_fee_for_message instead
Source

pub fn get_fee_for_message( &self, hash: &Hash, message: &SanitizedMessage, ) -> Option<u64>

Source

pub fn get_blockhash_last_valid_slot(&self, blockhash: &Hash) -> Option<Slot>

👎Deprecated since 1.6.11: Please use get_blockhash_last_valid_block_height
Source

pub fn get_blockhash_last_valid_block_height( &self, blockhash: &Hash, ) -> Option<Slot>

Source

pub fn confirmed_last_blockhash_with_fee_calculator( &self, ) -> (Hash, FeeCalculator)

👎Deprecated since 1.8.0: Please use confirmed_last_blockhash and get_fee_for_message instead
Source

pub fn confirmed_last_blockhash(&self) -> Hash

Source

pub fn clear_signatures(&self)

Forget all signatures. Useful for benchmarking.

Source

pub fn clear_slot_signatures(&self, slot: Slot)

Source

pub fn can_commit(result: &Result<()>) -> bool

Source

pub fn register_tick(&self, hash: &Hash)

Tell the bank which Entry IDs exist on the ledger. This function assumes subsequent calls correspond to later entries, and will boot the oldest ones once its internal cache is full. Once boot, the bank will reject transactions using that hash.

Source

pub fn is_complete(&self) -> bool

Source

pub fn is_block_boundary(&self, tick_height: u64) -> bool

Source

pub fn prepare_batch( &self, txs: Vec<Transaction>, ) -> Result<TransactionBatch<'_, '_>>

Prepare a transaction batch from a list of legacy transactionsy. Used for tests only.

Source

pub fn prepare_entry_batch( &self, txs: Vec<VersionedTransaction>, ) -> Result<TransactionBatch<'_, '_>>

Prepare a transaction batch from a list of versioned transactions from an entry. Used for tests only.

Source

pub fn prepare_sanitized_batch<'a, 'b>( &'a self, txs: &'b [SanitizedTransaction], ) -> TransactionBatch<'a, 'b>

Prepare a locked transaction batch from a list of sanitized transactions.

Source

pub fn simulate_transaction( &self, transaction: SanitizedTransaction, ) -> TransactionSimulationResult

Run transactions against a frozen bank without committing the results

Source

pub fn unlock_accounts(&self, batch: &mut TransactionBatch<'_, '_>)

Source

pub fn remove_unrooted_slots(&self, slots: &[(Slot, BankId)])

Source

pub fn set_shrink_paths(&self, paths: Vec<PathBuf>)

Source

pub fn check_hash_age(&self, hash: &Hash, max_age: usize) -> Option<bool>

Source

pub fn check_tx_durable_nonce( &self, tx: &SanitizedTransaction, ) -> Option<(Pubkey, AccountSharedData)>

Source

pub fn check_transactions( &self, sanitized_txs: &[SanitizedTransaction], lock_results: &[Result<()>], max_age: usize, error_counters: &mut ErrorCounters, ) -> Vec<TransactionCheckResult>

Source

pub fn collect_balances( &self, batch: &TransactionBatch<'_, '_>, ) -> TransactionBalances

Source

pub fn remove_executor(&self, pubkey: &Pubkey)

Remove an executor from the bank’s cache

Source

pub fn load_and_execute_transactions( &self, batch: &TransactionBatch<'_, '_>, max_age: usize, enable_cpi_recording: bool, enable_log_recording: bool, timings: &mut ExecuteTimings, ) -> (Vec<TransactionLoadResult>, Vec<TransactionExecutionResult>, Vec<Option<InnerInstructionsList>>, Vec<Option<TransactionLogMessages>>, Vec<usize>, u64, u64)

Source

pub fn commit_transactions( &self, sanitized_txs: &[SanitizedTransaction], loaded_txs: &mut [TransactionLoadResult], executed: &[TransactionExecutionResult], tx_count: u64, signature_count: u64, timings: &mut ExecuteTimings, ) -> TransactionResults

Source

pub fn cluster_type(&self) -> ClusterType

Source

pub fn load_execute_and_commit_transactions( &self, batch: &TransactionBatch<'_, '_>, max_age: usize, collect_balances: bool, enable_cpi_recording: bool, enable_log_recording: bool, timings: &mut ExecuteTimings, ) -> (TransactionResults, TransactionBalancesSet, Vec<Option<InnerInstructionsList>>, Vec<Option<TransactionLogMessages>>)

Process a batch of transactions.

Source

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

Process a Transaction. This is used for unit tests and simply calls the vector Bank::process_transactions method.

Source

pub fn process_transactions<'a>( &self, txs: impl Iterator<Item = &'a Transaction>, ) -> Vec<Result<()>>

Process multiple transaction in a single batch. This is used for benches and unit tests.

§Panics

Panics if any of the transactions do not pass sanitization checks.

Source

pub fn try_process_transactions<'a>( &self, txs: impl Iterator<Item = &'a Transaction>, ) -> Result<Vec<Result<()>>>

Process multiple transaction in a single batch. This is used for benches and unit tests. Short circuits if any of the transactions do not pass sanitization checks.

Source

pub fn process_entry_transactions( &self, txs: Vec<VersionedTransaction>, ) -> Vec<Result<()>>

Process entry transactions in a single batch. This is used for benches and unit tests.

§Panics

Panics if any of the transactions do not pass sanitization checks.

Source

pub fn try_process_entry_transactions( &self, txs: Vec<VersionedTransaction>, ) -> Result<Vec<Result<()>>>

Process multiple transaction in a single batch. This is used for benches and unit tests. Short circuits if any of the transactions do not pass sanitization checks.

Source

pub fn transfer( &self, n: u64, keypair: &Keypair, to: &Pubkey, ) -> Result<Signature>

Create, sign, and process a Transaction from keypair to to of n carats where blockhash is the last Entry ID observed by the client.

Source

pub fn read_balance(account: &AccountSharedData) -> u64

Source

pub fn get_balance(&self, pubkey: &Pubkey) -> u64

Each program would need to be able to introspect its own state this is hard-coded to the Budget language

Source

pub fn parents(&self) -> Vec<Arc<Bank>>

Compute all the parents of the bank in order

Source

pub fn parents_inclusive(self: Arc<Self>) -> Vec<Arc<Bank>>

Compute all the parents of the bank including this bank itself

Source

pub fn store_account(&self, pubkey: &Pubkey, account: &AccountSharedData)

Source

pub fn force_flush_accounts_cache(&self)

Source

pub fn flush_accounts_cache_if_needed(&self)

Source

pub fn expire_old_recycle_stores(&self)

Source

pub fn deposit(&self, pubkey: &Pubkey, carats: u64) -> Result<u64, CaratsError>

Source

pub fn accounts(&self) -> Arc<Accounts>

Source

pub fn set_inflation(&self, inflation: Inflation)

Source

pub fn set_compute_budget(&mut self, compute_budget: Option<ComputeBudget>)

Source

pub fn set_bpf_compute_budget( &mut self, bpf_compute_budget: Option<BpfComputeBudget>, )

👎Deprecated since 1.8.0: please use set_compute_budget instead
Source

pub fn hard_forks(&self) -> Arc<RwLock<HardForks>>

Source

pub fn get_account(&self, pubkey: &Pubkey) -> Option<AccountSharedData>

Source

pub fn get_account_with_fixed_root( &self, pubkey: &Pubkey, ) -> Option<AccountSharedData>

Source

pub fn get_account_modified_slot( &self, pubkey: &Pubkey, ) -> Option<(AccountSharedData, Slot)>

Source

pub fn get_program_accounts( &self, program_id: &Pubkey, ) -> ScanResult<Vec<(Pubkey, AccountSharedData)>>

Source

pub fn get_filtered_program_accounts<F: Fn(&AccountSharedData) -> bool>( &self, program_id: &Pubkey, filter: F, ) -> ScanResult<Vec<(Pubkey, AccountSharedData)>>

Source

pub fn get_filtered_indexed_accounts<F: Fn(&AccountSharedData) -> bool>( &self, index_key: &IndexKey, filter: F, ) -> ScanResult<Vec<(Pubkey, AccountSharedData)>>

Source

pub fn account_indexes_include_key(&self, key: &Pubkey) -> bool

Source

pub fn get_all_accounts_with_modified_slots( &self, ) -> ScanResult<Vec<(Pubkey, AccountSharedData, Slot)>>

Source

pub fn get_program_accounts_modified_since_parent( &self, program_id: &Pubkey, ) -> Vec<(Pubkey, AccountSharedData)>

Source

pub fn get_transaction_logs( &self, address: Option<&Pubkey>, ) -> Option<Vec<TransactionLogInfo>>

Source

pub fn get_all_accounts_modified_since_parent( &self, ) -> Vec<(Pubkey, AccountSharedData)>

Source

pub fn get_largest_accounts( &self, num: usize, filter_by_address: &HashSet<Pubkey>, filter: AccountAddressFilter, ) -> ScanResult<Vec<(Pubkey, u64)>>

Source

pub fn transaction_count(&self) -> u64

Source

pub fn transaction_error_count(&self) -> u64

Source

pub fn transaction_entries_count(&self) -> u64

Source

pub fn transactions_per_entry_max(&self) -> u64

Source

pub fn signature_count(&self) -> u64

Source

pub fn get_signature_status_processed_since_parent( &self, signature: &Signature, ) -> Option<Result<()>>

Source

pub fn get_signature_status_with_blockhash( &self, signature: &Signature, blockhash: &Hash, ) -> Option<Result<()>>

Source

pub fn get_signature_status_slot( &self, signature: &Signature, ) -> Option<(Slot, Result<()>)>

Source

pub fn get_signature_status(&self, signature: &Signature) -> Option<Result<()>>

Source

pub fn has_signature(&self, signature: &Signature) -> bool

Source

pub fn get_snapshot_storages(&self, base_slot: Option<Slot>) -> SnapshotStorages

Source

pub fn verify_transaction( &self, tx: VersionedTransaction, skip_verification: bool, ) -> Result<SanitizedTransaction>

Source

pub fn calculate_capitalization(&self, debug_verify: bool) -> u64

Source

pub fn calculate_and_verify_capitalization(&self, debug_verify: bool) -> bool

Source

pub fn set_capitalization(&self) -> u64

Forcibly overwrites current capitalization by actually recalculating accounts’ balances. This should only be used for developing purposes.

Source

pub fn get_accounts_hash(&self) -> Hash

Source

pub fn get_thread_pool(&self) -> &ThreadPool

Source

pub fn update_accounts_hash_with_index_option( &self, use_index: bool, debug_verify: bool, slots_per_epoch: Option<Slot>, ) -> Hash

Source

pub fn update_accounts_hash(&self) -> Hash

Source

pub fn verify_snapshot_bank( &self, test_hash_calculation: bool, accounts_db_skip_shrink: bool, last_full_snapshot_slot: Option<Slot>, ) -> bool

A snapshot bank should be purged of 0 carat accounts which are not part of the hash calculation and could shield other real accounts.

Source

pub fn hashes_per_tick(&self) -> &Option<u64>

Return the number of hashes per tick

Source

pub fn ticks_per_slot(&self) -> u64

Return the number of ticks per slot

Source

pub fn slots_per_year(&self) -> f64

Return the number of slots per year

Source

pub fn tick_height(&self) -> u64

Return the number of ticks since genesis.

Source

pub fn inflation(&self) -> Inflation

Return the inflation parameters of the Bank

Source

pub fn rent_collector(&self) -> RentCollector

Source

pub fn capitalization(&self) -> u64

Return the total capitalization of the Bank

Source

pub fn max_tick_height(&self) -> u64

Return this bank’s max_tick_height

Source

pub fn block_height(&self) -> u64

Return the block_height of this bank

Source

pub fn get_slots_in_epoch(&self, epoch: Epoch) -> u64

Return the number of slots per epoch for the given epoch

Source

pub fn get_leader_schedule_epoch(&self, slot: Slot) -> Epoch

returns the epoch for which this bank’s leader_schedule_slot_offset and slot would need to cache leader_schedule

Source

pub fn cloned_stake_delegations(&self) -> HashMap<Pubkey, Delegation>

current stake delegations for this bank

Source

pub fn staked_nodes(&self) -> Arc<HashMap<Pubkey, u64>>

Source

pub fn vote_accounts(&self) -> Arc<HashMap<Pubkey, (u64, VoteAccount)>>

current vote accounts for this bank along with the stake attributed to each account

Source

pub fn get_vote_account( &self, vote_account: &Pubkey, ) -> Option<(u64, VoteAccount)>

Vote account for the given vote account pubkey along with the stake.

Source

pub fn epoch_stakes(&self, epoch: Epoch) -> Option<&EpochStakes>

Get the EpochStakes for a given epoch

Source

pub fn epoch_stakes_map(&self) -> &HashMap<Epoch, EpochStakes>

Source

pub fn epoch_staked_nodes( &self, epoch: Epoch, ) -> Option<Arc<HashMap<Pubkey, u64>>>

Source

pub fn epoch_vote_accounts( &self, epoch: Epoch, ) -> Option<&HashMap<Pubkey, (u64, VoteAccount)>>

vote accounts for the specific epoch along with the stake attributed to each account

Source

pub fn epoch_authorized_voter(&self, vote_account: &Pubkey) -> Option<&Pubkey>

Get the fixed authorized voter for the given vote account for the current epoch

Source

pub fn epoch_vote_accounts_for_node_id( &self, node_id: &Pubkey, ) -> Option<&NodeVoteAccounts>

Get the fixed set of vote accounts for the given node id for the current epoch

Source

pub fn total_epoch_stake(&self) -> u64

Get the fixed total stake of all vote accounts for current epoch

Source

pub fn epoch_vote_account_stake(&self, vote_account: &Pubkey) -> u64

Get the fixed stake of the given vote account for the current epoch

Source

pub fn get_epoch_and_slot_index(&self, slot: Slot) -> (Epoch, SlotIndex)

given a slot, return the epoch and offset into the epoch this slot falls e.g. with a fixed number for slots_per_epoch, the calculation is simply:

( slot/slots_per_epoch, slot % slots_per_epoch )

Source

pub fn get_epoch_info(&self) -> EpochInfo

Source

pub fn is_empty(&self) -> bool

Source

pub fn add_builtin( &mut self, name: &str, program_id: Pubkey, process_instruction_with_context: ProcessInstructionWithContext, )

Add an instruction processor to intercept instructions before the dynamic loader.

Source

pub fn replace_builtin( &mut self, name: &str, program_id: Pubkey, process_instruction_with_context: ProcessInstructionWithContext, )

Replace a builtin instruction processor if it already exists

Source

pub fn clean_accounts( &self, skip_last: bool, is_startup: bool, last_full_snapshot_slot: Option<Slot>, )

Source

pub fn shrink_all_slots( &self, is_startup: bool, last_full_snapshot_slot: Option<Slot>, )

Source

pub fn print_accounts_stats(&self)

Source

pub fn process_stale_slot_with_budget( &self, consumed_budget: usize, budget_recovery_delta: usize, ) -> usize

Source

pub fn shrink_candidate_slots(&self) -> usize

Source

pub fn no_overflow_rent_distribution_enabled(&self) -> bool

Source

pub fn check_init_vote_data_enabled(&self) -> bool

Source

pub fn verify_tx_signatures_len_enabled(&self) -> bool

Source

pub fn merge_nonce_error_into_system_error(&self) -> bool

Source

pub fn versioned_tx_message_enabled(&self) -> bool

Source

pub fn stake_program_advance_activating_credits_observed(&self) -> bool

Source

pub fn demote_program_write_locks(&self) -> bool

Source

pub fn stakes_remove_delegation_if_inactive_enabled(&self) -> bool

Source

pub fn should_bank_still_be_processing_txs( bank_creation_time: &Instant, max_tx_ingestion_nanos: u128, ) -> bool

Source

pub fn deactivate_feature(&mut self, id: &Pubkey)

Source

pub fn activate_feature(&mut self, id: &Pubkey)

Source

pub fn fill_bank_with_ticks(&self)

Trait Implementations§

Source§

impl AbiExample for Bank

Source§

fn example() -> Self

Source§

impl Debug for Bank

Source§

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

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

impl Drop for Bank

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl PartialEq for Bank

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

§

impl !Freeze for Bank

§

impl !RefUnwindSafe for Bank

§

impl Send for Bank

§

impl Sync for Bank

§

impl Unpin for Bank

§

impl !UnwindSafe for Bank

Blanket Implementations§

Source§

impl<T> AbiExample for T

Source§

default fn example() -> T

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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

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

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

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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