AccountsDb

Struct AccountsDb 

Source
pub struct AccountsDb {
Show 20 fields pub accounts_index: AccountsIndex<AccountInfo, AccountInfo>, pub ancient_append_vec_offset: Option<i64>, pub ancient_storage_ideal_size: u64, pub max_ancient_storages: usize, pub skip_initial_hash_calc: bool, pub storage: AccountStorage, pub accounts_cache: AccountsCache, pub next_id: AtomicAccountsFileId, pub shrink_candidate_slots: Mutex<IntSet<Slot>>, pub write_version: AtomicU64, pub paths: Vec<PathBuf>, pub temp_paths: Option<Vec<TempDir>>, pub thread_pool_foreground: ThreadPool, pub thread_pool_background: ThreadPool, pub stats: AccountsStats, pub shrink_stats: ShrinkStats, pub account_indexes: AccountSecondaryIndexes, pub log_dead_slots: AtomicBool, pub partitioned_epoch_rewards_config: PartitionedEpochRewardsConfig, pub mark_obsolete_accounts: MarkObsoleteAccounts, /* private fields */
}
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Fields§

§accounts_index: AccountsIndex<AccountInfo, AccountInfo>
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Keeps tracks of index into AppendVec on a per slot basis

§ancient_append_vec_offset: Option<i64>
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Some(offset) iff we want to squash old append vecs together into ‘ancient append vecs’ Some(offset) means for slots up to (max_slot - (slots_per_epoch - ‘offset’)), put them in ancient append vecs

§ancient_storage_ideal_size: u64
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
§max_ancient_storages: usize
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
§skip_initial_hash_calc: bool
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

true iff we want to skip the initial hash calculation on startup

§storage: AccountStorage
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
§accounts_cache: AccountsCache
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
§next_id: AtomicAccountsFileId
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

distribute the accounts across storage lists

§shrink_candidate_slots: Mutex<IntSet<Slot>>
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Set of shrinkable stores organized by map of slot to storage id

§write_version: AtomicU64
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
§paths: Vec<PathBuf>
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Set of storage paths to pick from

§temp_paths: Option<Vec<TempDir>>
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Directory of paths this accounts_db needs to hold/remove

§thread_pool_foreground: ThreadPool
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Thread pool for foreground tasks, e.g. transaction processing

§thread_pool_background: ThreadPool
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Thread pool for background tasks, e.g. AccountsBackgroundService and flush/clean/shrink

§stats: AccountsStats
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
§shrink_stats: ShrinkStats
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
§account_indexes: AccountSecondaryIndexes
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
§log_dead_slots: AtomicBool
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Used to disable logging dead slots during removal. allow disabling noisy log

§partitioned_epoch_rewards_config: PartitionedEpochRewardsConfig
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

this will live here until the feature for partitioned epoch rewards is activated. At that point, this and other code can be deleted.

§mark_obsolete_accounts: MarkObsoleteAccounts
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Flag to indicate if the experimental obsolete account tracking feature is enabled. This feature tracks obsolete accounts in the account storage entry allowing for earlier cleaning of obsolete accounts in the storages and index.

Implementations§

Source§

impl AccountsDb

Source

pub fn notify_account_at_accounts_update( &self, slot: Slot, account: &AccountSharedData, txn: &Option<&SanitizedTransaction>, pubkey: &Pubkey, write_version: u64, )

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source§

impl AccountsDb

Source

pub fn new_with_config( paths: Vec<PathBuf>, accounts_db_config: AccountsDbConfig, accounts_update_notifier: Option<AccountsUpdateNotifier>, exit: Arc<AtomicBool>, ) -> Self

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn file_size(&self) -> u64

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn get_base_working_path(&self) -> PathBuf

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Get the base working directory

Source

pub fn has_accounts_update_notifier(&self) -> bool

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Returns true if there is an accounts update notifier.

Source

pub fn purge_keys_exact<C>( &self, pubkey_to_slot_set: impl IntoIterator<Item = (Pubkey, C)>, ) -> (ReclaimsSlotList<AccountInfo>, HashSet<Pubkey>)
where C: for<'a> Contains<'a, Slot>,

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn clean_accounts( &self, max_clean_root_inclusive: Option<Slot>, is_startup: bool, epoch_schedule: &EpochSchedule, )

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn get_unique_accounts_from_storage( &self, store: &AccountStorageEntry, ) -> GetUniqueAccountsResult

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

get all accounts in all the storages passed in for duplicate pubkeys, the account with the highest write_value is returned

Source

pub fn mark_dirty_dead_stores( &self, slot: Slot, add_dirty_stores: bool, shrink_in_progress: Option<ShrinkInProgress<'_>>, shrink_can_be_active: bool, ) -> Vec<Arc<AccountStorageEntry>>

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

get stores for ‘slot’ Drop ‘shrink_in_progress’, which will cause the old store to be removed from the storage map. For ‘shrink_in_progress’.‘old_storage’ which is not retained, insert in ‘dead_storages’ and optionally ‘dirty_stores’ This is the end of the life cycle of shrink_in_progress.

Source

pub fn get_store_for_shrink( &self, slot: Slot, size: u64, ) -> ShrinkInProgress<'_>

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

return a store that can contain ‘size’ bytes

Source

pub fn shrink_ancient_slots(&self, epoch_schedule: &EpochSchedule)

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

get a sorted list of slots older than an epoch squash those slots into ancient append vecs

Source

pub fn shrink_candidate_slots(&self, epoch_schedule: &EpochSchedule) -> usize

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn shrink_all_slots( &self, is_startup: bool, epoch_schedule: &EpochSchedule, newest_slot_skip_shrink_inclusive: Option<Slot>, )

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

This is only called at startup from bank when we are being extra careful such as when we downloaded a snapshot. Also called from tests. newest_slot_skip_shrink_inclusive is used to avoid shrinking the slot we are loading a snapshot from. If we shrink that slot, we affect the bank hash calculation verification at startup.

Source

pub fn scan_accounts<F>( &self, ancestors: &Ancestors, bank_id: BankId, scan_func: F, config: &ScanConfig, ) -> ScanResult<()>

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn index_scan_accounts<F>( &self, ancestors: &Ancestors, bank_id: BankId, index_key: IndexKey, scan_func: F, config: &ScanConfig, ) -> ScanResult<bool>

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn scan_cache_storage_fallback<R, B>( &self, slot: Slot, cache_map_func: impl Fn(&LoadedAccount<'_>) -> Option<R> + Sync, storage_fallback_func: impl Fn(&mut B, &AccountsFile) + Sync, ) -> ScanStorageResult<R, B>
where R: Send, B: Send + Default + Sync,

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Scan the cache with a fallback to storage for a specific slot.

Source

pub fn load( &self, ancestors: &Ancestors, pubkey: &Pubkey, load_hint: LoadHint, ) -> Option<(AccountSharedData, Slot)>

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn load_account_into_read_cache( &self, ancestors: &Ancestors, pubkey: &Pubkey, )

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

load the account with pubkey into the read only accounts cache. The goal is to make subsequent loads (which caller expects to occur) to find the account quickly.

Source

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

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

note this returns None for accounts with zero lamports

Source

pub fn load_account_with( &self, ancestors: &Ancestors, pubkey: &Pubkey, should_put_in_read_cache: bool, ) -> Option<(AccountSharedData, Slot)>

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Load account with pubkey and maybe put into read cache.

Return the account and the slot when the account was last stored. Return None for ZeroLamport accounts.

Source

pub fn enable_bank_drop_callback(&self)

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn purge_slot( &self, slot: Slot, bank_id: BankId, is_serialized_with_abs: bool, )

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

This should only be called after the Bank::drop() runs in bank.rs, See BANK_DROP_SAFETY comment below for more explanation.

  • is_serialized_with_abs - indicates whether this call runs sequentially with all other accounts_db relevant calls, such as shrinking, purging etc., in accounts background service.
Source

pub fn purge_slots_from_cache_and_store<'a>( &self, removed_slots: impl Iterator<Item = &'a Slot> + Clone, purge_stats: &PurgeStats, )

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Purges every slot in removed_slots from both the cache and storage. This includes entries in the accounts index, cache entries, and any backing storage entries.

Source

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

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn lt_hash_account( account: &impl ReadableAccount, pubkey: &Pubkey, ) -> AccountLtHash

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Calculates the AccountLtHash of account

Source

pub fn mark_slot_frozen(&self, slot: Slot)

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn flush_accounts_cache( &self, force_flush: bool, requested_flush_root: Option<Slot>, )

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn calculate_accounts_lt_hash_at_startup_from_index( &self, ancestors: &Ancestors, startup_slot: Slot, ) -> AccountsLtHash

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Calculates the accounts lt hash

Only intended to be called at startup (or by tests). Only intended to be used while testing the experimental accumulator hash.

Source

pub fn calculate_capitalization_at_startup_from_index( &self, ancestors: &Ancestors, startup_slot: Slot, ) -> u64

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Calculates the capitalization

Panics if capitalization overflows a u64.

Note, this is very expensive! It walks the whole accounts index, account-by-account, summing each account’s balance.

Only intended to be called at startup by ledger-tool or tests.

Source

pub fn get_pubkeys_for_slot(&self, slot: Slot) -> Vec<Pubkey>

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Returns all of the accounts’ pubkeys for a given slot

Source

pub fn get_pubkey_account_for_slot( &self, slot: Slot, ) -> Vec<(Pubkey, AccountSharedData)>

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Return all of the accounts for a given slot

Source

pub fn store_accounts_frozen<'a>( &self, accounts: impl StorableAccounts<'a>, storage: &Arc<AccountStorageEntry>, update_index_thread_selection: UpdateIndexThreadSelection, ) -> StoreAccountsTiming

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Stores accounts in the storage and updates the index. This function is intended for accounts that are rooted (frozen).

  • UpsertReclaims is set to IgnoreReclaims. If the slot in accounts differs from the new slot, accounts may be removed from the account index. In such cases, the caller must ensure that alive accounts are decremented for the older storage or that the old storage is removed entirely
Source

pub fn add_root(&self, slot: Slot) -> AccountsAddRootTiming

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn get_storages( &self, requested_slots: impl RangeBounds<Slot> + Sync, ) -> (Vec<Arc<AccountStorageEntry>>, Vec<Slot>)

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Returns storages for requested_slots

Source

pub fn latest_full_snapshot_slot(&self) -> Option<Slot>

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Returns the latest full snapshot slot

Source

pub fn set_latest_full_snapshot_slot(&self, slot: Slot)

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Sets the latest full snapshot slot to slot

Source

pub fn generate_index( &self, limit_load_slot_count_from_snapshot: Option<usize>, verify: bool, ) -> IndexGenerationInfo

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn print_accounts_stats(&self, label: &str)

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
Source

pub fn print_count_and_status(&self, label: &str)

👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.

Trait Implementations§

Source§

impl Debug for AccountsDb

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> 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> PolicyExt for T
where T: ?Sized,

Source§

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

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

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

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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

Source§

impl<T> MaybeSendSync for T