Skip to main content

PalletCmd

Struct PalletCmd 

Source
pub struct PalletCmd {
Show 44 fields pub pallets: Vec<String>, pub extrinsic: Option<String>, pub exclude_pallets: Vec<String>, pub exclude_extrinsics: Vec<String>, pub all: bool, pub steps: u32, pub lowest_range_values: Vec<u32>, pub highest_range_values: Vec<u32>, pub repeat: u32, pub external_repeat: Option<u32>, pub min_duration: u64, pub json_output: bool, pub json_file: Option<PathBuf>, pub no_median_slopes: bool, pub no_min_squares: bool, pub output: Option<PathBuf>, pub header: Option<PathBuf>, pub template: Option<PathBuf>, pub hostinfo_params: HostInfoParams, pub output_analysis: Option<String>, pub output_pov_analysis: Option<String>, pub default_pov_mode: PovEstimationMode, pub ignore_unknown_pov_mode: bool, pub heap_pages: Option<u64>, pub no_verify: bool, pub extra: bool, pub shared_params: SharedParams, pub wasm_method: WasmExecutionMethod, pub wasmtime_instantiation_strategy: WasmtimeInstantiationStrategy, pub runtime: Option<PathBuf>, pub runtime_log: Option<String>, pub allow_missing_host_functions: bool, pub genesis_builder: Option<GenesisBuilderPolicy>, pub genesis_builder_preset: String, pub execution: Option<String>, pub database_cache_size: u32, pub list: Option<ListOutput>, pub no_csv_header: bool, pub no_storage_info: bool, pub worst_case_map_values: u32, pub additional_trie_layers: u8, pub json_input: Option<PathBuf>, pub unsafe_overwrite_results: bool, pub genesis_patch: Option<PathBuf>, /* private fields */
}
Expand description

Benchmark the extrinsic weight of FRAME Pallets.

Fields§

§pallets: Vec<String>

Select a FRAME Pallets to benchmark, or * for all (in which case extrinsic must be *).

§extrinsic: Option<String>

Select an extrinsic inside the pallet to benchmark, or * or ‘all’ for all.

§exclude_pallets: Vec<String>

Comma separated list of pallets that should be excluded from the benchmark.

§exclude_extrinsics: Vec<String>

Comma separated list of pallet::extrinsic combinations that should not be run.

Example: frame_system::remark,pallet_balances::transfer_keep_alive

§all: bool

Run benchmarks for all pallets and extrinsics.

This is equivalent to running --pallet * --extrinsic *.

§steps: u32

Select how many samples we should take across the variable components.

§lowest_range_values: Vec<u32>

Indicates lowest values for each of the component ranges.

§highest_range_values: Vec<u32>

Indicates highest values for each of the component ranges.

§repeat: u32

Minimum number of repetitions of this benchmark should run from within the wasm.

It may run more often than this to reach its min_duration.

§external_repeat: Option<u32>

DEPRECATED: Please remove usage.

§min_duration: u64

Minimum duration in seconds for each benchmark.

Can be set to 0 to disable the feature and solely rely on the repeat parameter.

§json_output: bool

Print the raw results in JSON format.

§json_file: Option<PathBuf>

Write the raw results in JSON format into the given file.

§no_median_slopes: bool

Don’t print the median-slopes linear regression analysis.

§no_min_squares: bool

Don’t print the min-squares linear regression analysis.

§output: Option<PathBuf>

Output the benchmarks to a Rust file at the given path.

§header: Option<PathBuf>

Add a header file to your outputted benchmarks.

§template: Option<PathBuf>

Path to Handlebars template file used for outputting benchmark results. (Optional)

§hostinfo_params: HostInfoParams§output_analysis: Option<String>

Which analysis function to use when outputting benchmarks:

  • min-squares (default)
  • median-slopes
  • max (max of min squares and median slopes for each value)
§output_pov_analysis: Option<String>

Which analysis function to use when analyzing measured proof sizes.

§default_pov_mode: PovEstimationMode

The PoV estimation mode of a benchmark if no pov_mode attribute is present.

§ignore_unknown_pov_mode: bool

Ignore the error when PoV modes reference unknown storage items or pallets.

§heap_pages: Option<u64>

Set the heap pages while running benchmarks. If not set, the default value from the client is used.

§no_verify: bool

Disable verification logic when running benchmarks.

§extra: bool

Display and run extra benchmarks that would otherwise not be needed for weight construction.

§shared_params: SharedParams§wasm_method: WasmExecutionMethod

Method for executing Wasm runtime code.

§wasmtime_instantiation_strategy: WasmtimeInstantiationStrategy

The WASM instantiation method to use.

Only has an effect when wasm-execution is set to compiled.

§runtime: Option<PathBuf>

Optional runtime blob to use instead of the one from the genesis config.

§runtime_log: Option<String>

Set the runtime log level.

This will overwrite the RUNTIME_LOG environment variable. If neither is set, the CLI default set by RUST_LOG setting is used.

§allow_missing_host_functions: bool

Do not fail if there are unknown but also unused host functions in the runtime.

§genesis_builder: Option<GenesisBuilderPolicy>

How to construct the genesis state.

Uses GenesisBuilderPolicy::Spec by default.

§genesis_builder_preset: String

The preset that we expect to find in the GenesisBuilder runtime API.

This can be useful when a runtime has a dedicated benchmarking preset instead of using the default one.

§execution: Option<String>

DEPRECATED: This argument has no effect.

§database_cache_size: u32

Limit the memory the database cache can use.

§list: Option<ListOutput>

List and print available benchmarks in a csv-friendly format.

NOTE: num_args and require_equals are required to allow --list

§no_csv_header: bool

Don’t include csv header when listing benchmarks.

§no_storage_info: bool

If enabled, the storage info is not displayed in the output next to the analysis.

This is independent of the storage info appearing in the output file. Use a Handlebar template for that purpose.

§worst_case_map_values: u32

The assumed default maximum size of any StorageMap.

When the maximum size of a map is not defined by the runtime developer, this value is used as a worst case scenario. It will affect the calculated worst case PoV size for accessing a value in a map, since the PoV will need to include the trie nodes down to the underlying value.

§additional_trie_layers: u8

Adjust the PoV estimation by adding additional trie layers to it.

This should be set to log16(n) where n is the number of top-level storage items in the runtime, eg. StorageMaps and StorageValues. A value of 2 to 3 is usually sufficient. Each layer will result in an additional 495 bytes PoV per distinct top-level access. Therefore multiple StorageMap accesses only suffer from this increase once. The exact number of storage items depends on the runtime and the deployed pallets.

§json_input: Option<PathBuf>

A path to a .json file with existing benchmark results generated with --json or --json-file. When specified the benchmarks are not actually executed, and the data for the analysis is read from this file.

§unsafe_overwrite_results: bool

Allow overwriting a single file with multiple results.

This exists only to restore legacy behaviour. It should never actually be needed.

§genesis_patch: Option<PathBuf>

Path to a JSON file containing a patch to apply to the genesis state.

This allows modifying the genesis state after it’s built but before benchmarking. Useful for creating specific testing scenarios like many accounts for benchmarking.

Implementations§

Source§

impl PalletCmd

Source

pub fn run_with_spec<Hasher, ExtraHostFunctions>( &self, chain_spec: Option<Box<dyn ChainSpec>>, ) -> Result<()>
where Hasher: Hash, <Hasher as Hash>::Output: DecodeWithMemTracking, ExtraHostFunctions: HostFunctions,

Runs the pallet benchmarking command.

Trait Implementations§

Source§

impl Args for PalletCmd

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl CliConfiguration for PalletCmd

Source§

fn shared_params(&self) -> &SharedParams

Get the SharedParams for this object
Source§

fn chain_id(&self, _is_dev: bool) -> Result<String>

Get the chain ID (string). Read more
Source§

fn import_params(&self) -> Option<&ImportParams>

Get the ImportParams for this object
Source§

fn pruning_params(&self) -> Option<&PruningParams>

Get the PruningParams for this object
Source§

fn keystore_params(&self) -> Option<&KeystoreParams>

Get the KeystoreParams for this object
Source§

fn network_params(&self) -> Option<&NetworkParams>

Get the NetworkParams for this object
Source§

fn offchain_worker_params(&self) -> Option<&OffchainWorkerParams>

Get a reference to OffchainWorkerParams for this object.
Source§

fn node_key_params(&self) -> Option<&NodeKeyParams>

Get the NodeKeyParams for this object
Source§

fn database_params(&self) -> Option<&DatabaseParams>

Get the DatabaseParams for this object
Source§

fn base_path(&self) -> Result<Option<BasePath>, Error>

Get the base path of the configuration (if any) Read more
Source§

fn is_dev(&self) -> Result<bool, Error>

Returns true if the node is for development or not Read more
Source§

fn role(&self, _is_dev: bool) -> Result<Role, Error>

Gets the role Read more
Source§

fn transaction_pool( &self, _is_dev: bool, ) -> Result<TransactionPoolOptions, Error>

Get the transaction pool options Read more
Source§

fn network_config( &self, chain_spec: &Box<dyn ChainSpec>, is_dev: bool, is_validator: bool, net_config_dir: PathBuf, client_id: &str, node_name: &str, node_key: NodeKeyConfig, default_listen_port: u16, ) -> Result<NetworkConfiguration, Error>

Get the network configuration Read more
Source§

fn keystore_config(&self, config_dir: &PathBuf) -> Result<KeystoreConfig, Error>

Get the keystore configuration. Read more
Source§

fn database_cache_size(&self) -> Result<Option<usize>, Error>

Get the database cache size. Read more
Source§

fn database(&self) -> Result<Option<Database>, Error>

Get the database backend variant. Read more
Source§

fn database_config( &self, base_path: &PathBuf, cache_size: usize, database: Database, ) -> Result<DatabaseSource, Error>

Get the database configuration object for the parameters provided
Source§

fn trie_cache_maximum_size(&self) -> Result<Option<usize>, Error>

Get the trie cache maximum size. Read more
Source§

fn warm_up_trie_cache(&self) -> Result<Option<TrieCacheWarmUpStrategy>, Error>

Get if we should warm up the trie cache. Read more
Source§

fn state_pruning(&self) -> Result<Option<PruningMode>, Error>

Get the state pruning mode. Read more
Source§

fn blocks_pruning(&self) -> Result<BlocksPruning, Error>

Get the block pruning mode. Read more
Source§

fn node_name(&self) -> Result<String, Error>

Get the name of the node. Read more
Source§

fn wasm_method(&self) -> Result<WasmExecutionMethod, Error>

Get the WASM execution method. Read more
Source§

fn wasm_runtime_overrides(&self) -> Option<PathBuf>

Get the path where WASM overrides live. Read more
Source§

fn rpc_addr( &self, _default_listen_port: u16, ) -> Result<Option<Vec<RpcEndpoint>>, Error>

Get the RPC address.
Source§

fn rpc_methods(&self) -> Result<RpcMethods, Error>

Returns the RPC method set to expose. Read more
Source§

fn rpc_max_connections(&self) -> Result<u32, Error>

Get the maximum number of RPC server connections.
Source§

fn rpc_cors(&self, _is_dev: bool) -> Result<Option<Vec<String>>, Error>

Get the RPC cors (None if disabled) Read more
Source§

fn rpc_max_request_size(&self) -> Result<u32, Error>

Get maximum RPC request payload size.
Source§

fn rpc_max_response_size(&self) -> Result<u32, Error>

Get maximum RPC response payload size.
Source§

fn rpc_max_subscriptions_per_connection(&self) -> Result<u32, Error>

Get maximum number of subscriptions per connection.
Source§

fn rpc_buffer_capacity_per_connection(&self) -> Result<u32, Error>

The number of messages the RPC server is allowed to keep in memory per connection.
Source§

fn rpc_batch_config(&self) -> Result<BatchRequestConfig, Error>

RPC server batch request configuration.
Source§

fn rpc_rate_limit(&self) -> Result<Option<NonZero<u32>>, Error>

RPC rate limit configuration.
Source§

fn rpc_rate_limit_whitelisted_ips(&self) -> Result<Vec<IpNetwork>, Error>

RPC rate limit whitelisted ip addresses.
Source§

fn rpc_rate_limit_trust_proxy_headers(&self) -> Result<bool, Error>

RPC rate limit trust proxy headers.
Source§

fn prometheus_config( &self, _default_listen_port: u16, _chain_spec: &Box<dyn ChainSpec>, ) -> Result<Option<PrometheusConfig>, Error>

Get the prometheus configuration (None if disabled) Read more
Source§

fn telemetry_endpoints( &self, chain_spec: &Box<dyn ChainSpec>, ) -> Result<Option<TelemetryEndpoints>, Error>

Get the telemetry endpoints (if any) Read more
Source§

fn default_heap_pages(&self) -> Result<Option<u64>, Error>

Get the default value for heap pages Read more
Source§

fn offchain_worker(&self, role: &Role) -> Result<OffchainWorkerConfig, Error>

Returns an offchain worker config wrapped in Ok(_) Read more
Source§

fn force_authoring(&self) -> Result<bool, Error>

Returns Ok(true) if authoring should be forced Read more
Source§

fn disable_grandpa(&self) -> Result<bool, Error>

Returns Ok(true) if grandpa should be disabled Read more
Source§

fn dev_key_seed(&self, _is_dev: bool) -> Result<Option<String>, Error>

Get the development key seed from the current object Read more
Source§

fn tracing_targets(&self) -> Result<Option<String>, Error>

Get the tracing targets from the current object (if any) Read more
Source§

fn tracing_receiver(&self) -> Result<TracingReceiver, Error>

Get the TracingReceiver value from the current object Read more
Source§

fn node_key(&self, net_config_dir: &PathBuf) -> Result<NodeKeyConfig, Error>

Get the node key from the current object Read more
Source§

fn max_runtime_instances(&self) -> Result<Option<usize>, Error>

Get maximum runtime instances Read more
Source§

fn runtime_cache_size(&self) -> Result<u8, Error>

Get maximum different runtimes in cache Read more
Source§

fn announce_block(&self) -> Result<bool, Error>

Activate or not the automatic announcing of blocks after import Read more
Source§

fn create_configuration<C>( &self, cli: &C, tokio_handle: Handle, ) -> Result<Configuration, Error>
where C: SubstrateCli,

Create a Configuration object from the current object
Source§

fn log_filters(&self) -> Result<String, Error>

Get the filters for the logging. Read more
Source§

fn detailed_log_output(&self) -> Result<bool, Error>

Should the detailed log output be enabled.
Source§

fn enable_log_reloading(&self) -> Result<bool, Error>

Is log reloading enabled?
Source§

fn disable_log_color(&self) -> Result<bool, Error>

Should the log color output be disabled?
Source§

fn init<F>( &self, support_url: &String, impl_version: &String, logger_hook: F, ) -> Result<(), Error>
where F: FnOnce(&mut LoggerBuilder),

Initialize substrate. This must be done only once per process. Read more
Source§

impl CommandFactory for PalletCmd

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for PalletCmd

Source§

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

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

impl FromArgMatches for PalletCmd

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for PalletCmd

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

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

Source§

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

Source§

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

Source§

fn type_name(&self) -> &'static str

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

impl<T> CheckedConversion for T

Source§

fn checked_from<T>(t: T) -> Option<Self>
where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
Source§

fn checked_into<T>(self) -> Option<T>
where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. 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<T, U> DefensiveTruncateInto<U> for T

Source§

fn defensive_truncate_into(self) -> U

Defensively truncate a value and convert it into its bounded form.
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> 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, U> IntoKey<U> for T
where U: FromKey<T>,

Source§

fn into_key(self) -> U

Source§

impl<Src, Dest> IntoTuple<Dest> for Src
where Dest: FromTuple<Src>,

Source§

fn into_tuple(self) -> Dest

Source§

impl<T> IsType<T> for T

Source§

fn from_ref(t: &T) -> &T

Cast reference.
Source§

fn into_ref(&self) -> &T

Cast reference.
Source§

fn from_mut(t: &mut T) -> &mut T

Cast mutable reference.
Source§

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

Cast mutable reference.
Source§

impl<T, Outer> IsWrappedBy<Outer> for T
where Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

Source§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

Source§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

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> 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> SaturatedConversion for T

Source§

fn saturated_from<T>(t: T) -> Self
where Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
Source§

fn saturated_into<T>(self) -> T
where Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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> 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, U> TryIntoKey<U> for T
where U: TryFromKey<T>,

Source§

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

Source§

fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>

Source§

impl<S, T> UncheckedInto<T> for S
where T: UncheckedFrom<S>,

Source§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
Source§

impl<T, S> UniqueSaturatedInto<T> for S
where T: Bounded, S: TryInto<T>,

Source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
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> 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> JsonSchemaMaybe for T

Source§

impl<T> MaybeDebug for T
where T: Debug,

Source§

impl<T> MaybeRefUnwindSafe for T
where T: RefUnwindSafe,

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSendSync for T