ProtocolFeature

Enum ProtocolFeature 

Source
pub enum ProtocolFeature {
Show 89 variants _DeprecatedImplicitAccountCreation, _DeprecatedRectifyInflation, _DeprecatedAccessKeyNonceRange, _DeprecatedFixApplyChunks, _DeprecatedLowerStorageCost, _DeprecatedDeleteActionRestriction, _DeprecatedAccountVersions, _DeprecatedTransactionSizeLimit, _DeprecatedFixStorageUsage, _DeprecatedCapMaxGasPrice, _DeprecatedCountRefundReceiptsInGasLimit, _DeprecatedMathExtension, _DeprecatedRestoreReceiptsAfterFixApplyChunks, _DeprecatedMinProtocolVersionNep92, _DeprecatedMinProtocolVersionNep92Fix, _DeprecatedCorrectRandomValue, _DeprecatedEnableInflation, _DeprecatedUpgradabilityFix, _DeprecatedCreateHash, _DeprecatedDeleteKeyStorageUsage, _DeprecatedShardChunkHeaderUpgrade, _DeprecatedCreateReceiptIdSwitchToCurrentBlock, _DeprecatedFixedMinimumNewReceiptGas, _DeprecatedWasmer2, SimpleNightshade, _DeprecatedLowerDataReceiptAndEcrecoverBaseCost, _DeprecatedLowerRegularOpCost, _DeprecatedLowerRegularOpCost2, _DeprecatedLimitContractFunctionsNumber, _DeprecatedBlockHeaderV3, _DeprecatedAliasValidatorSelectionAlgorithm, _DeprecatedSynchronizeBlockChunkProduction, _DeprecatedCorrectStackLimit, _DeprecatedAccessKeyNonceForImplicitAccounts, _DeprecatedIncreaseDeploymentCost, _DeprecatedFunctionCallWeight, _DeprecatedLimitContractLocals, _DeprecatedChunkNodesCache, _DeprecatedLowerStorageKeyLimit, _DeprecatedAltBn128, _DeprecatedChunkOnlyProducers, _DeprecatedMaxKickoutStake, _DeprecatedAccountIdInFunctionCallPermission, _DeprecatedZeroBalanceAccount, _DeprecatedDelegateAction, _DeprecatedEd25519Verify, _DeprecatedComputeCosts, _DeprecatedDecreaseFunctionCallBaseCost, _DeprecatedFlatStorageReads, _DeprecatedPreparationV2, _DeprecatedNearVmRuntime, _DeprecatedBlockHeaderV4, SimpleNightshadeV2, SimpleNightshadeV3, _DeprecatedFixStakingThreshold, _DeprecatedFixChunkProducerStakingThreshold, FixContractLoadingCost, _DeprecatedRejectBlocksWithOutdatedProtocolVersions, _DeprecatedBLS12381, _DeprecatedRestrictTla, _DeprecatedTestnetFewerBlockProducers, _DeprecatedStatelessValidation, _DeprecatedEthImplicitAccounts, _DeprecatedYieldExecution, _DeprecatedFixMinStakeRatio, _DeprecatedIncreaseStorageProofSizeSoftLimit, ShuffleShardAssignments, _DeprecatedCongestionControl, _DeprecatedRemoveAccountWithLongStorageKey, _DeprecatedChunkEndorsementV2, _DeprecatedChunkEndorsementsInBlockHeader, _DeprecatedStateStoredReceipt, SimpleNightshadeV4, SimpleNightshadeV5, SimpleNightshadeV6, _DeprecatedExcludeContractCodeFromStateWitness, _DeprecatedBandwidthScheduler, _DeprecatedCurrentEpochStateSync, _DeprecatedRelaxedChunkValidation, _DeprecatedRemoveCheckBalance, ExcludeExistingCodeFromWitnessForCodeLen, BlockHeightForReceiptId, ProduceOptimisticBlock, GlobalContracts, ReducedGasRefunds, VersionedStateWitness, IncreaseMaxCongestionMissedChunks, SaturatingFloatToInt, ChunkPartChecks,
}
Expand description

New Protocol features should go here. Features are guarded by their corresponding feature flag. For example, if we have ProtocolFeature::EVM and a corresponding feature flag evm, it will look like

#[cfg(feature = “protocol_feature_evm”)] EVM code

Variants§

§

_DeprecatedImplicitAccountCreation

👎Deprecated
§

_DeprecatedRectifyInflation

👎Deprecated
§

_DeprecatedAccessKeyNonceRange

👎Deprecated

Add AccessKey nonce range by setting nonce to (block_height - 1) * 1e6, see https://github.com/near/nearcore/issues/3779.

§

_DeprecatedFixApplyChunks

👎Deprecated

Don’t process any receipts for shard when chunk is not present. Always use gas price computed in the previous block.

§

_DeprecatedLowerStorageCost

👎Deprecated
§

_DeprecatedDeleteActionRestriction

👎Deprecated
§

_DeprecatedAccountVersions

👎Deprecated

Add versions to Account data structure

§

_DeprecatedTransactionSizeLimit

👎Deprecated
§

_DeprecatedFixStorageUsage

👎Deprecated

Fix a bug in storage_usage for account caused by #3824

§

_DeprecatedCapMaxGasPrice

👎Deprecated

Cap maximum gas price to 2,000,000,000 yoctoNEAR

§

_DeprecatedCountRefundReceiptsInGasLimit

👎Deprecated
§

_DeprecatedMathExtension

👎Deprecated

Add ripemd60 and ecrecover host function

§

_DeprecatedRestoreReceiptsAfterFixApplyChunks

👎Deprecated

Restore receipts that were previously stuck because of https://github.com/near/nearcore/pull/4228.

§

_DeprecatedMinProtocolVersionNep92

👎Deprecated

Minimum protocol version for NEP-92

§

_DeprecatedMinProtocolVersionNep92Fix

👎Deprecated

Minimum protocol version for NEP-92 fix

§

_DeprecatedCorrectRandomValue

👎Deprecated

Creates a unique random seed to be provided to VMContext from a given action_hash and a given random_seed

§

_DeprecatedEnableInflation

👎Deprecated

The protocol version that enables reward on mainnet

§

_DeprecatedUpgradabilityFix

👎Deprecated

Fix upgrade to use the latest voted protocol version instead of the current epoch protocol version when there is no new change in protocol version

§

_DeprecatedCreateHash

👎Deprecated

Updates the way receipt ID, data ID and random seeds are constructed

§

_DeprecatedDeleteKeyStorageUsage

👎Deprecated

Fix the storage usage of the delete key action

§

_DeprecatedShardChunkHeaderUpgrade

👎Deprecated

Upgrade for shard chunk header

§

_DeprecatedCreateReceiptIdSwitchToCurrentBlock

👎Deprecated

Updates the way receipt ID is constructed to use current block hash instead of last block hash

§

_DeprecatedFixedMinimumNewReceiptGas

👎Deprecated

Pessimistic gas price estimation uses a fixed value of minimum_new_receipt_gas to stop being tied to the function call base cost

§

_DeprecatedWasmer2

👎Deprecated

This feature switch our WASM engine implementation from wasmer 0.* to wasmer 2.*, bringing better performance and reliability.

The implementations should be sufficiently similar for this to not be a protocol upgrade, but we conservatively do a protocol upgrade to be on the safe side.

Although wasmer2 is faster, we don’t change fees with this protocol version – we can safely do that in a separate step.

§

SimpleNightshade

§

_DeprecatedLowerDataReceiptAndEcrecoverBaseCost

👎Deprecated
§

_DeprecatedLowerRegularOpCost

👎Deprecated

Lowers the cost of wasm instruction due to switch to wasmer2.

§

_DeprecatedLowerRegularOpCost2

👎Deprecated

Lowers the cost of wasm instruction due to switch to faster, compiler-intrinsics based gas counter.

§

_DeprecatedLimitContractFunctionsNumber

👎Deprecated

Limit number of wasm functions in one contract. See https://github.com/near/nearcore/pull/4954 for more details.

§

_DeprecatedBlockHeaderV3

👎Deprecated
§

_DeprecatedAliasValidatorSelectionAlgorithm

👎Deprecated

Changes how we select validators for epoch and how we select validators within epoch. See https://github.com/near/NEPs/pull/167 for general description, note that we would not introduce chunk-only validators with this feature

§

_DeprecatedSynchronizeBlockChunkProduction

👎Deprecated

Make block producers produce chunks for the same block they would later produce to avoid network delays

§

_DeprecatedCorrectStackLimit

👎Deprecated

Change the algorithm to count WASM stack usage to avoid under counting in some cases.

§

_DeprecatedAccessKeyNonceForImplicitAccounts

👎Deprecated

Add AccessKey nonce range for implicit accounts, as in AccessKeyNonceRange feature.

§

_DeprecatedIncreaseDeploymentCost

👎Deprecated

Increase cost per deployed code byte to cover for the compilation steps that a deployment triggers. Only affects the action execution cost.

§

_DeprecatedFunctionCallWeight

👎Deprecated
§

_DeprecatedLimitContractLocals

👎Deprecated

This feature enforces a global limit on the function local declarations in a WebAssembly contract. See <…> for more information.

§

_DeprecatedChunkNodesCache

👎Deprecated

Ensure caching all nodes in the chunk for which touching trie node cost was charged. Charge for each such node only once per chunk at the first access time.

§

_DeprecatedLowerStorageKeyLimit

👎Deprecated

Lower max_length_storage_key limit, which itself limits trie node sizes.

§

_DeprecatedAltBn128

👎Deprecated
§

_DeprecatedChunkOnlyProducers

👎Deprecated
§

_DeprecatedMaxKickoutStake

👎Deprecated

Ensure the total stake of validators that are kicked out does not exceed a percentage of total stakes

§

_DeprecatedAccountIdInFunctionCallPermission

👎Deprecated

Validate account id for function call access keys.

§

_DeprecatedZeroBalanceAccount

👎Deprecated

Zero Balance Account NEP 448: https://github.com/near/NEPs/pull/448

§

_DeprecatedDelegateAction

👎Deprecated

Execute a set of actions on behalf of another account.

Meta Transaction NEP-366: https://github.com/near/NEPs/blob/master/neps/nep-0366.md

§

_DeprecatedEd25519Verify

👎Deprecated
§

_DeprecatedComputeCosts

👎Deprecated

Decouple compute and gas costs of operations to safely limit the compute time it takes to process the chunk.

Compute Costs NEP-455: https://github.com/near/NEPs/blob/master/neps/nep-0455.md

§

_DeprecatedDecreaseFunctionCallBaseCost

👎Deprecated

Decrease the cost of function call action. Only affects the execution cost.

§

_DeprecatedFlatStorageReads

👎Deprecated

Enable flat storage for reads, reducing number of DB accesses from 2 * key.len() in the worst case to 2.

Flat Storage NEP-399: https://github.com/near/NEPs/blob/master/neps/nep-0399.md

§

_DeprecatedPreparationV2

👎Deprecated

Enables preparation V2. Note that this setting is not supported in production settings without NearVmRuntime enabled alongside it, as the VM runner would be too slow.

§

_DeprecatedNearVmRuntime

👎Deprecated

Enables Near-Vm. Note that this setting is not at all supported without PreparationV2, as it hardcodes preparation v2 code into the generated assembly.

§

_DeprecatedBlockHeaderV4

👎Deprecated
§

SimpleNightshadeV2

Resharding V2. A new implementation for resharding and a new shard layout for the production networks.

§

SimpleNightshadeV3

Built on top of Resharding V2. Changes shard layout to V3 to split shard 2 into two parts.

§

_DeprecatedFixStakingThreshold

👎Deprecated

In case not all validator seats are occupied our algorithm provide incorrect minimal seat price - it reports as alpha * sum_stake instead of alpha * sum_stake / (1 - alpha), where alpha is min stake ratio

§

_DeprecatedFixChunkProducerStakingThreshold

👎Deprecated

In case not all validator seats are occupied, the minimum seat price of a chunk producer used to depend on the number of existing shards, which is no longer the case.

§

FixContractLoadingCost

Charge for contract loading before it happens.

§

_DeprecatedRejectBlocksWithOutdatedProtocolVersions

👎Deprecated

Enables rejection of blocks with outdated protocol versions.

§

_DeprecatedBLS12381

👎Deprecated
§

_DeprecatedRestrictTla

👎Deprecated
§

_DeprecatedTestnetFewerBlockProducers

👎Deprecated

Increases the number of chunk producers.

§

_DeprecatedStatelessValidation

👎Deprecated

Enables stateless validation which is introduced in https://github.com/near/NEPs/pull/509 LowerValidatorKickoutPercentForDebugging: lower block and chunk validator kickout percent from 90 to 50. SingleShardTracking: single shard tracking for stateless validation. StateWitnessSizeLimit: state witness size limits. PerReceiptHardStorageProofLimit: limit the size of storage proof generated by a single receipt. WitnessTransactionLimits: size limits for transactions included in a ChunkStateWitness. NoChunkOnlyProducers: no chunk-only producers in stateless validation.

§

_DeprecatedEthImplicitAccounts

👎Deprecated
§

_DeprecatedYieldExecution

👎Deprecated

Enables yield execution which is introduced in https://github.com/near/NEPs/pull/519

§

_DeprecatedFixMinStakeRatio

👎Deprecated

Bring minimum required validator stake effectively to ~10K NEAR as of 2024-08-15. Fixes increase to 100K NEAR in the previous protocol version. See #11953 for more details.

§

_DeprecatedIncreaseStorageProofSizeSoftLimit

👎Deprecated

Increases main_storage_proof_size_soft_limit parameter from 3mb to 4mb

§

ShuffleShardAssignments

§

_DeprecatedCongestionControl

👎Deprecated

Cross-shard congestion control according to https://github.com/near/NEPs/pull/539.

§

_DeprecatedRemoveAccountWithLongStorageKey

👎Deprecated

Remove account with long storage key.

§

_DeprecatedChunkEndorsementV2

👎Deprecated

Change the structure of ChunkEndorsement to have (shard_id, epoch_id, height_created) instead of chunk_hash

§

_DeprecatedChunkEndorsementsInBlockHeader

👎Deprecated
§

_DeprecatedStateStoredReceipt

👎Deprecated

Store receipts in State in the StateStoredReceipt format.

§

SimpleNightshadeV4

Resharding V3 - Adding “game.hot.tg-0” boundary.

§

SimpleNightshadeV5

Resharding V3 - Adding “earn.kaiching” boundary.

§

SimpleNightshadeV6

Resharding V3 - Adding “650” boundary.

§

_DeprecatedExcludeContractCodeFromStateWitness

👎Deprecated

Exclude contract code from the chunk state witness and distribute it to chunk validators separately.

§

_DeprecatedBandwidthScheduler

👎Deprecated

A scheduler which limits bandwidth for sending receipts between shards.

§

_DeprecatedCurrentEpochStateSync

Indicates that the “sync_hash” used to identify the point in the chain to sync state to should no longer be the first block of the epoch, but a couple blocks after that in order to sync the current epoch’s state. This is not strictly a protocol feature, but is included here to coordinate among nodes

§

_DeprecatedRelaxedChunkValidation

👎Deprecated: Was used for protocol versions without relaxed chunk validation which is not supported anymore.

Relaxed validation of transactions included in a chunk.

Chunks no longer become entirely invalid in case invalid transactions are included in the chunk. Instead the transactions are discarded during their conversion to receipts.

support for code that does not do relaxed chunk validation has now been removed.

§

_DeprecatedRemoveCheckBalance

👎Deprecated: Was used for protocol versions where we checked balances which is not supported anymore.

This enables us to remove the expensive check_balance call from the runtime.

Support for code that does check balances has now been removed.

§

ExcludeExistingCodeFromWitnessForCodeLen

Exclude existing contract code in deploy-contract and delete-account actions from the chunk state witness. Instead of sending code in the witness, the code checks the code-size using the internal trie nodes.

§

BlockHeightForReceiptId

Use the block height instead of the block hash to calculate the receipt ID.

§

ProduceOptimisticBlock

Enable optimistic block production.

§

GlobalContracts

§

ReducedGasRefunds

NEP: https://github.com/near/NEPs/pull/536

Reduce the number of gas refund receipts by charging the current gas price rather than a pessimistic gas price. Also, introduce a new fee of 5% for gas refunds and charge the signer this fee for gas refund receipts.

§

VersionedStateWitness

Move from ChunkStateWitness being a single struct to a versioned enum.

§

IncreaseMaxCongestionMissedChunks

Increase max_congestion_missed_chunks from 5 to 125. At 125 missing chunks shard will be fully congested. At 100 missing chunks shard will be 80% congested, and transactions targeting it will be rejected as per reject_tx_congestion_threshold config.

It improves UX during long ranges of missing chunks, as transactions are much less likely to get rejected with ShardStuck error.

§

SaturatingFloatToInt

§

ChunkPartChecks

Implementations§

Source§

impl ProtocolFeature

Source

pub const fn protocol_version(self) -> u32

Source

pub fn enabled(&self, protocol_version: u32) -> bool

Trait Implementations§

Source§

impl Clone for ProtocolFeature

Source§

fn clone(&self) -> ProtocolFeature

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProtocolFeature

Source§

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

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

impl Hash for ProtocolFeature

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ProtocolFeature

Source§

fn eq(&self, other: &ProtocolFeature) -> 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.
Source§

impl Copy for ProtocolFeature

Source§

impl Eq for ProtocolFeature

Source§

impl StructuralPartialEq for ProtocolFeature

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Conv for T

Source§

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

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> FmtForward for T

Source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

Source§

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

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

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

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

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

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

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

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

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

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

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

Immutable access to a value. Read more
Source§

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

Mutable access to a value. Read more
Source§

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> TryConv for T

Source§

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

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