pub trait Default: Sized {
// Required method
fn default() -> Self;
}Expand description
A trait for giving a type a useful default value.
Sometimes, you want to fall back to some kind of default value, and
don’t particularly care what it is. This comes up often with structs
that define a set of options:
struct SomeOptions {
foo: i32,
bar: f32,
}How can we define some default values? You can use Default:
#[derive(Default)]
struct SomeOptions {
foo: i32,
bar: f32,
}
fn main() {
let options: SomeOptions = Default::default();
}Now, you get all of the default values. Rust implements Default for various primitive types.
If you want to override a particular option, but still retain the other defaults:
fn main() {
let options = SomeOptions { foo: 42, ..Default::default() };
}§Derivable
This trait can be used with #[derive] if all of the type’s fields implement
Default. When derived, it will use the default value for each field’s type.
§enums
When using #[derive(Default)] on an enum, you need to choose which unit variant will be
default. You do this by placing the #[default] attribute on the variant.
#[derive(Default)]
enum Kind {
#[default]
A,
B,
C,
}You cannot use the #[default] attribute on non-unit or non-exhaustive variants.
The #[default] attribute was stabilized in Rust 1.62.0.
§How can I implement Default?
Provide an implementation for the default() method that returns the value of
your type that should be the default:
enum Kind {
A,
B,
C,
}
impl Default for Kind {
fn default() -> Self { Kind::A }
}§Examples
#[derive(Default)]
struct SomeOptions {
foo: i32,
bar: f32,
}Required Methods§
1.0.0 · Sourcefn default() -> Self
fn default() -> Self
Returns the “default value” for a type.
Default values are often some kind of initial value, identity value, or anything else that may make sense as a default.
§Examples
Using built-in default values:
let i: i8 = Default::default();
let (x, y): (Option<String>, f64) = Default::default();
let (a, b, (c, d)): (i32, u32, (bool, bool)) = Default::default();Making your own:
enum Kind {
A,
B,
C,
}
impl Default for Kind {
fn default() -> Self { Kind::A }
}Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl Default for &str
impl Default for &CStr
impl Default for &OsStr
impl Default for &mut str
impl Default for ExtrinsicInclusionMode
impl Default for StateVersion
impl Default for WasmLevel
impl Default for Abi
impl Default for AsciiChar
impl Default for aho_corasick::packed::api::MatchKind
impl Default for aho_corasick::util::search::MatchKind
The default match kind is MatchKind::Standard.
impl Default for StartKind
impl Default for Language
impl Default for byteorder::BigEndian
impl Default for byteorder::LittleEndian
impl Default for PollNext
impl Default for DwarfFileType
impl Default for RunTimeEndian
impl Default for Pointer
impl Default for Case
impl Default for PrefilterConfig
impl Default for Color
impl Default for Endianness
impl Default for WhichCaptures
impl Default for regex_automata::util::search::MatchKind
impl Default for ExtractKind
impl Default for MonthRepr
Creates a modifier that indicates the value uses the
Numerical representation.
impl Default for Padding
Creates a modifier that indicates the value is padded with zeroes.
impl Default for SubsecondDigits
Creates a modifier that indicates the stringified value contains one or more digits.
impl Default for TrailingInput
Indicate that any trailing characters after the end of input are prohibited and will cause
an error when used with parse.
impl Default for UnixTimestampPrecision
Creates a modifier that indicates the value represents the number of seconds since the Unix epoch.
impl Default for WeekNumberRepr
Creates a modifier that indicates that the value uses the Iso representation.
impl Default for WeekdayRepr
Creates a modifier that indicates the value uses the Long representation.
impl Default for YearRange
Creates a modifier that indicates the value uses the Extended range.
impl Default for YearRepr
Creates a modifier that indicates the value uses the Full representation.
impl Default for TrieSpec
impl Default for bool
impl Default for char
impl Default for f16
impl Default for f32
impl Default for f64
impl Default for f128
impl Default for i8
impl Default for i16
impl Default for i32
impl Default for i64
impl Default for i128
impl Default for isize
impl Default for u8
impl Default for u16
impl Default for u32
impl Default for u64
impl Default for u128
impl Default for ()
impl Default for usize
impl Default for AllocationStats
impl Default for BigUint
impl Default for FixedI64
impl Default for FixedI128
impl Default for FixedU64
impl Default for FixedU128
impl Default for PerU16
impl Default for Perbill
impl Default for Percent
impl Default for Permill
impl Default for Perquintill
impl Default for Rational128
impl Default for RationalInfinite
impl Default for BabeEpochConfiguration
impl Default for MmrLeafVersion
impl Default for Slot
impl Default for CryptoTypeId
impl Default for KeyTypeId
impl Default for InMemOffchainStorage
impl Default for subsoil::core::offchain::Duration
impl Default for OpaqueNetworkState
impl Default for subsoil::core::offchain::Timestamp
impl Default for OffchainState
impl Default for PendingRequest
impl Default for PoolState
impl Default for TestOffchainExt
impl Default for TestPersistentOffchainDB
impl Default for TestTransactionPoolExt
impl Default for H160
impl Default for H256
impl Default for H512
impl Default for OpaquePeerId
impl Default for U256
impl Default for U512
impl Default for TaskExecutor
std only.impl Default for MemDb
impl Default for Extensions
impl Default for CheckInherentsResult
impl Default for InherentData
impl Default for UseDalekExt
substrate_runtime only.impl Default for MemoryKeystore
impl Default for ElectionScore
impl Default for Digest
impl Default for Time
impl Default for AnySignature
impl Default for Justifications
impl Default for OpaqueExtrinsic
impl Default for UintAuthorityId
impl Default for ValidTransaction
impl Default for ValidTransactionBuilder
impl Default for OpaqueGeneratedSessionKeys
impl Default for MembershipProof
impl Default for OffenceSeverity
impl Default for BasicExternalities
impl Default for OffchainOverlayedChanges
impl Default for StateMachineStats
impl Default for UsageUnit
impl Default for Storage
impl Default for StorageData
impl Default for subsoil::timestamp::Timestamp
impl Default for Data
impl Default for TraceError
impl Default for WasmEntryAttributes
impl Default for WasmMetadata
impl Default for HitStatsSnapshot
impl Default for TrieHitStatsSnapshot
impl Default for subsoil::trie::RandomState
impl Default for TrieStream
impl Default for RuntimeVersion
impl Default for RuntimeDbWeight
impl Default for Weight
impl Default for subsoil::std::alloc::Global
impl Default for System
impl Default for subsoil::std::fmt::Error
impl Default for FormattingOptions
impl Default for DefaultHasher
impl Default for SipHasher
impl Default for PhantomPinned
impl Default for RangeFull
impl Default for subsoil::std::prelude::Box<str>
no_global_oom_handling only.impl Default for subsoil::std::prelude::Box<CStr>
impl Default for subsoil::std::prelude::Box<OsStr>
impl Default for Alignment
Returns Alignment::MIN, which is valid for any type.
impl Default for Rc<str>
no_global_oom_handling only.impl Default for Rc<CStr>
no_global_oom_handling only.impl Default for Writer
impl Default for Atomic<bool>
target_has_atomic_load_store=8 only.impl Default for Atomic<i8>
impl Default for Atomic<i16>
impl Default for Atomic<i32>
impl Default for Atomic<i64>
impl Default for Atomic<isize>
impl Default for Atomic<u8>
impl Default for Atomic<u16>
impl Default for Atomic<u32>
impl Default for Atomic<u64>
impl Default for Atomic<usize>
impl Default for subsoil::std::sync::nonpoison::Condvar
impl Default for Arc<str>
no_global_oom_handling only.impl Default for Arc<CStr>
no_global_oom_handling only.impl Default for subsoil::std::sync::Condvar
impl Default for subsoil::std::time::Duration
impl Default for ByteString
impl Default for CString
impl Default for String
impl Default for OsString
impl Default for FileTimes
impl Default for std::io::util::Empty
impl Default for Sink
impl Default for PathBuf
impl Default for ExitCode
The default value is ExitCode::SUCCESS
impl Default for ExitStatus
The default value is one which indicates successful completion.
impl Default for DefaultRandomSource
impl Default for Adler32
impl Default for AHasher
Provides a default Hasher with fixed keys. This is typically used in conjunction with BuildHasherDefault to create AHashers in order to hash the keys of the map.
Generally it is preferable to use RandomState instead, so that different hashmaps will have different keys. However if fixed keys are desirable this may be used instead.
§Example
use std::hash::BuildHasherDefault;
use ahash::{AHasher, RandomState};
use std::collections::HashMap;
let mut map: HashMap<i32, i32, BuildHasherDefault<AHasher>> = HashMap::default();
map.insert(12, 34);impl Default for ahash::random_state::RandomState
compile-time-rng or runtime-rng or no-rng only.Creates an instance of RandomState using keys obtained from the random number generator. Each instance created in this way will have a unique set of keys. (But the resulting instance can be used to create many hashers each or which will have the same keys.)
This is the same as RandomState::new()
NOTE: For safety this trait impl is only available available if either of the flags runtime-rng (on by default) or
compile-time-rng are enabled. This is to prevent weakly keyed maps from being accidentally created. Instead one of
constructors for RandomState must be used.
impl Default for AhoCorasickBuilder
impl Default for aho_corasick::dfa::Builder
impl Default for aho_corasick::nfa::contiguous::Builder
impl Default for aho_corasick::nfa::noncontiguous::Builder
impl Default for aho_corasick::packed::api::Builder
impl Default for aho_corasick::packed::api::Config
impl Default for aho_corasick::util::primitives::PatternID
impl Default for aho_corasick::util::primitives::StateID
impl Default for allocator_api2::stable::alloc::global::Global
impl Default for Backtrace
impl Default for GeneralPurposeConfig
impl Default for bitcoin_hashes::ripemd160::HashEngine
impl Default for bitcoin_hashes::sha1::HashEngine
impl Default for bitcoin_hashes::sha256::HashEngine
impl Default for Midstate
impl Default for bitcoin_hashes::sha384::HashEngine
impl Default for bitcoin_hashes::sha512::HashEngine
impl Default for bitcoin_hashes::sha512_256::HashEngine
impl Default for bitcoin_hashes::siphash24::HashEngine
impl Default for blake2b_simd::blake2bp::Params
impl Default for blake2b_simd::blake2bp::State
impl Default for blake2b_simd::Params
impl Default for blake2b_simd::State
impl Default for Eager
impl Default for block_buffer::Lazy
impl Default for bytes::bytes::Bytes
impl Default for BytesMut
impl Default for CompressedEdwardsY
impl Default for EdwardsPoint
impl Default for MontgomeryPoint
impl Default for CompressedRistretto
impl Default for RistrettoPoint
impl Default for curve25519_dalek::scalar::Scalar
impl Default for digest::errors::InvalidOutputSize
impl Default for MacError
impl Default for InvalidBufferSize
impl Default for digest::InvalidOutputSize
impl Default for VerifyingKey
impl Default for Verifier
impl Default for VerificationKey
impl Default for CommitValidationResult
impl Default for foldhash::fast::FixedState
impl Default for foldhash::fast::RandomState
impl Default for foldhash::fast::SeedableRandomState
impl Default for foldhash::quality::FixedState
impl Default for foldhash::quality::RandomState
impl Default for foldhash::quality::SeedableRandomState
impl Default for AtomicWaker
impl Default for LocalPool
impl Default for ThreadPoolBuilder
impl Default for LineEncoding
impl Default for gimli::endianity::BigEndian
impl Default for gimli::endianity::LittleEndian
impl Default for Abbreviations
impl Default for AbbreviationsCache
impl Default for Augmentation
impl Default for BaseAddresses
impl Default for SectionBaseAddresses
impl Default for Hash256StdHasher
impl Default for itoa::Buffer
impl Default for DBTransaction
impl Default for Field
impl Default for FieldStorage
impl Default for Affine
impl Default for AffineStorage
impl Default for Jacobian
impl Default for libsecp256k1_core::scalar::Scalar
impl Default for SecretKey
impl Default for MetadataBuilder<'_>
impl Default for RecordBuilder<'_>
impl Default for FinderBuilder
impl Default for DecompressorOxide
impl Default for InflateState
impl Default for Style
impl Default for num_format::buffer::Buffer
impl Default for CustomFormat
impl Default for object::endian::BigEndian
impl Default for object::endian::LittleEndian
impl Default for ImageSectionHeader
impl Default for RelocationSections
impl Default for VersionIndex
impl Default for Relocation
impl Default for RelocationMap
impl Default for OnceBool
impl Default for OnceNonZeroUsize
impl Default for FunctionBuilder
impl Default for FunctionDefinition
impl Default for SignatureBuilder
impl Default for SignaturesBuilder
impl Default for DataSegmentBuilder
impl Default for ExportBuilder
impl Default for GlobalBuilder
impl Default for ImportBuilder
impl Default for MemoryBuilder
impl Default for ModuleBuilder
impl Default for TableBuilder
impl Default for TableDefinition
impl Default for Module
impl Default for FunctionNameSubsection
impl Default for LocalNameSubsection
impl Default for CodeSection
impl Default for CustomSection
impl Default for DataSection
impl Default for ElementSection
impl Default for ExportSection
impl Default for FunctionSection
impl Default for GlobalSection
impl Default for ImportSection
impl Default for MemorySection
impl Default for TableSection
impl Default for TypeSection
impl Default for FunctionType
impl Default for parking_lot::condvar::Condvar
impl Default for Once
impl Default for UnparkResult
impl Default for SpinWait
impl Default for FormatterOptions
impl Default for H128
impl Default for H384
impl Default for H768
impl Default for primitive_types::U128
impl Default for ThreadRng
impl Default for OsRng
impl Default for regex_automata::dense_imp::Builder
std only.impl Default for regex_automata::dfa::onepass::Config
impl Default for regex_automata::hybrid::dfa::Config
impl Default for LazyStateID
impl Default for regex_automata::hybrid::regex::Builder
impl Default for regex_automata::meta::regex::Config
impl Default for regex_automata::nfa::thompson::backtrack::Config
impl Default for regex_automata::nfa::thompson::builder::Builder
impl Default for regex_automata::nfa::thompson::compiler::Config
impl Default for regex_automata::nfa::thompson::pikevm::Config
impl Default for RegexBuilder
std only.impl Default for ByteClasses
impl Default for GroupInfo
impl Default for LookMatcher
impl Default for regex_automata::util::look::LookSet
impl Default for regex_automata::util::primitives::PatternID
impl Default for SmallIndex
impl Default for regex_automata::util::primitives::StateID
impl Default for regex_automata::util::syntax::Config
impl Default for regex_syntax::ast::parse::ParserBuilder
impl Default for regex_syntax::ast::parse::ParserBuilder
impl Default for Extractor
impl Default for regex_syntax::hir::ClassBytesRange
impl Default for regex_syntax::hir::ClassBytesRange
impl Default for regex_syntax::hir::ClassUnicodeRange
impl Default for regex_syntax::hir::ClassUnicodeRange
impl Default for regex_syntax::hir::LookSet
impl Default for regex_syntax::hir::translate::TranslatorBuilder
impl Default for regex_syntax::hir::translate::TranslatorBuilder
impl Default for regex_syntax::parser::ParserBuilder
impl Default for regex_syntax::parser::ParserBuilder
impl Default for regex::regexset::bytes::RegexSet
impl Default for regex::regexset::string::RegexSet
impl Default for FxHasher
impl Default for PortableRegistryBuilder
impl Default for scale_info::registry::Registry
impl Default for Unlimited
impl Default for UnlimitedCompact
impl Default for schnellru::RandomState
impl Default for PublicKey
impl Default for RistrettoBoth
impl Default for VRFPreOut
impl Default for RecoverableSignature
impl Default for AlignedType
impl Default for Secp256k1<All>
impl Default for IgnoredAny
impl Default for Keccak224Core
impl Default for Keccak256Core
impl Default for Keccak256FullCore
impl Default for Keccak384Core
impl Default for Keccak512Core
impl Default for Sha3_224Core
impl Default for Sha3_256Core
impl Default for Sha3_384Core
impl Default for Sha3_512Core
impl Default for Shake128Core
impl Default for Shake256Core
impl Default for signature::error::Error
impl Default for time::duration::Duration
impl Default for Day
Creates a modifier that indicates the value is padded with zeroes.
impl Default for End
Creates a modifier used to represent the end of input, not allowing any trailing input (i.e. the input must be fully consumed).
impl Default for Hour
Creates a modifier that indicates the value is padded with zeroes and has the 24-hour representation.
impl Default for Minute
Creates a modifier that indicates the value is padded with zeroes.
impl Default for Month
Creates an instance of this type that indicates the value uses the
Numerical representation, is padded with zeroes,
and is case-sensitive when parsing.
impl Default for OffsetHour
Creates a modifier that indicates the value only uses a sign for negative values and is padded with zeroes.
impl Default for OffsetMinute
Creates a modifier that indicates the value is padded with zeroes.
impl Default for OffsetSecond
Creates a modifier that indicates the value is padded with zeroes.
impl Default for Ordinal
Creates a modifier that indicates the value is padded with zeroes.
impl Default for Period
Creates a modifier that indicates the value uses the upper-case representation and is case-sensitive when parsing.
impl Default for Second
Creates a modifier that indicates the value is padded with zeroes.
impl Default for Subsecond
Creates a modifier that indicates the stringified value contains one or more digits.
impl Default for UnixTimestamp
Creates a modifier that indicates the value represents the number of seconds since the Unix epoch. The sign is not mandatory.
impl Default for WeekNumber
Creates a modifier that indicates that the value is padded with zeroes
and uses the Iso representation.
impl Default for Weekday
Creates a modifier that indicates the value uses the Long
representation and is case-sensitive when parsing. If the representation is changed to a
numerical one, the instance defaults to one-based indexing.
impl Default for Year
Creates a modifier that indicates the value uses the Full
representation, is padded with zeroes, uses the Gregorian calendar as its
base, and only includes the year’s sign if necessary.
impl Default for Dispatch
impl Default for NoSubscriber
impl Default for tracing_log::log_tracer::Builder
impl Default for LogTracer
impl Default for tracing_subscriber::filter::env::builder::Builder
impl Default for Directive
impl Default for EnvFilter
impl Default for Targets
impl Default for Pretty
impl Default for PrettyFields
impl Default for Compact
impl Default for DefaultFields
impl Default for Format
impl Default for Full
impl Default for Subscriber
impl Default for SubscriberBuilder
impl Default for SystemTime
impl Default for Uptime
impl Default for TestWriter
impl Default for Identity
impl Default for tracing_subscriber::registry::sharded::Registry
impl Default for NibbleVec
impl Default for TrieFactory
impl Default for XxHash64
impl Default for RandomXxHashBuilder64
impl Default for RandomXxHashBuilder32
impl Default for RandomHashBuilder64
impl Default for RandomHashBuilder128
impl Default for XxHash32
impl Default for Hash64
impl Default for Hash128
impl Default for B0
impl Default for B1
impl Default for Z0
impl Default for Equal
impl Default for Greater
impl Default for Less
impl Default for UTerm
impl Default for vec128_storage
impl Default for vec256_storage
impl Default for vec512_storage
impl<'a> Default for &'a ByteStr
impl<'a> Default for &'a mut ByteStr
impl<'a> Default for IterArgs<'a>
impl<'a> Default for PhantomContravariantLifetime<'a>
impl<'a> Default for PhantomCovariantLifetime<'a>
impl<'a> Default for PhantomInvariantLifetime<'a>
impl<'a, H, I> Default for KeysIter<'a, H, I>
impl<'a, H, I> Default for PairsIter<'a, H, I>
impl<'a, K, V> Default for subsoil::std::collections::btree_map::Iter<'a, K, V>where
K: 'a,
V: 'a,
impl<'a, K, V> Default for subsoil::std::collections::btree_map::IterMut<'a, K, V>where
K: 'a,
V: 'a,
impl<'a, T> Default for OnceRef<'a, T>
impl<'data> Default for object::read::coff::section::SectionTable<'data>
impl<'data> Default for Version<'data>
impl<'data> Default for RelocationBlockIterator<'data>
impl<'data> Default for ObjectMap<'data>
impl<'data> Default for ObjectMapEntry<'data>
impl<'data> Default for object::read::util::Bytes<'data>
impl<'data, E> Default for LoadCommandIterator<'data, E>
impl<'data, Elf> Default for VersionTable<'data, Elf>where
Elf: FileHeader,
impl<'data, Elf, R> Default for object::read::elf::section::SectionTable<'data, Elf, R>where
Elf: FileHeader,
R: ReadRef<'data>,
impl<'data, Elf, R> Default for object::read::elf::symbol::SymbolTable<'data, Elf, R>where
Elf: FileHeader,
R: ReadRef<'data>,
impl<'data, Mach, R> Default for object::read::macho::symbol::SymbolTable<'data, Mach, R>where
Mach: MachHeader,
R: ReadRef<'data>,
impl<'data, R> Default for StringTable<'data, R>where
R: ReadRef<'data>,
impl<'data, R, Coff> Default for object::read::coff::symbol::SymbolTable<'data, R, Coff>where
R: ReadRef<'data>,
Coff: CoffHeader,
impl<'data, Xcoff> Default for object::read::xcoff::section::SectionTable<'data, Xcoff>where
Xcoff: FileHeader,
impl<'data, Xcoff, R> Default for object::read::xcoff::symbol::SymbolTable<'data, Xcoff, R>where
Xcoff: FileHeader,
R: ReadRef<'data>,
impl<'input, Endian> Default for EndianSlice<'input, Endian>
impl<'s, T> Default for SliceVec<'s, T>
impl<A> Default for TinyVec<A>where
A: Array,
impl<A> Default for allocator_api2::stable::boxed::Box<str, A>
impl<A> Default for SmallVec<A>where
A: Array,
impl<A> Default for tinyvec::arrayvec::ArrayVec<A>where
A: Array,
impl<A, B> Default for Chain<A, B>
impl<A, B: Default + HasCompact> Default for ExposurePage<A, B>
impl<AccountId> Default for Support<AccountId>
impl<AccountId, Balance: Default + HasCompact> Default for Exposure<AccountId, Balance>
impl<AccountId: Default> Default for Candidate<AccountId>
impl<AccountId: Default> Default for StakedAssignment<AccountId>
impl<AccountId: Default> Default for Voter<AccountId>
impl<AccountId: Default, P: Default + PerThing> Default for Assignment<AccountId, P>
impl<AuthoritySetCommitment: Default> Default for BeefyAuthoritySet<AuthoritySetCommitment>
impl<B> Default for Cow<'_, B>
impl<B: BlockNumberProvider> Default for BlockAndTime<B>
impl<B: BlockNumberProvider> Default for BlockAndTimeDeadline<B>
impl<Balance: Default + HasCompact + MaxEncodedLen> Default for PagedExposureMetadata<Balance>
impl<Balance: Default> Default for Stake<Balance>
impl<BlockSize, Kind> Default for BlockBuffer<BlockSize, Kind>
impl<E> Default for CompressionHeader32<E>
impl<E> Default for CompressionHeader64<E>
impl<E> Default for Sym32<E>
impl<E> Default for Sym64<E>
impl<E> Default for I16Bytes<E>
impl<E> Default for I32Bytes<E>
impl<E> Default for I64Bytes<E>
impl<E> Default for U16Bytes<E>
impl<E> Default for U32Bytes<E>
impl<E> Default for U64Bytes<E>
impl<E> Default for FormattedFields<E>
impl<F> Default for OptionFuture<F>
impl<F> Default for Variants<F>
impl<F> Default for UtcTime<F>where
F: Formattable + Default,
impl<F, N, T> Default for FieldBuilder<F, N, T>where
F: Form,
impl<F, S> Default for TypeBuilder<F, S>where
F: Form,
impl<F, T> Default for FieldsBuilder<F, T>where
F: Form,
impl<Fut> Default for FuturesOrdered<Fut>where
Fut: Future,
impl<Fut> Default for FuturesUnordered<Fut>
impl<H> Default for TrieBackend<PrefixedMemoryDB<H>, H>
impl<H> Default for IgnoredNodes<H>
impl<H> Default for BuildHasherDefault<H>
impl<H, KF, T> Default for MemoryDB<H, KF, T>
impl<H, N, S, Id> Default for HistoricalVotes<H, N, S, Id>
impl<H: Hasher> Default for OverlayedChanges<H>
impl<H: Hasher> Default for StorageChanges<H>
impl<H: Hasher> Default for TestExternalities<H>
impl<H: Hasher> Default for subsoil::trie::recorder::Recorder<H>
impl<H: Default> Default for Transaction<H>
impl<H: Default> Default for NodeCodec<H>
impl<I> Default for Cloned<I>where
I: Default,
impl<I> Default for Copied<I>where
I: Default,
impl<I> Default for Enumerate<I>where
I: Default,
impl<I> Default for Flatten<I>
impl<I> Default for Fuse<I>where
I: Default,
impl<I> Default for Rev<I>where
I: Default,
impl<Idx> Default for subsoil::std::ops::Range<Idx>where
Idx: Default,
impl<Idx> Default for core::range::Range<Idx>where
Idx: Default,
impl<K> Default for std::collections::hash::set::IntoIter<K>
impl<K> Default for std::collections::hash::set::Iter<'_, K>
impl<K> Default for hashbrown::set::Iter<'_, K>
impl<K, A> Default for hashbrown::set::IntoIter<K, A>where
A: Allocator,
impl<K, V> Default for BTreeMap<K, V>
impl<K, V> Default for subsoil::std::collections::btree_map::Keys<'_, K, V>
impl<K, V> Default for subsoil::std::collections::btree_map::Range<'_, K, V>
impl<K, V> Default for RangeMut<'_, K, V>
impl<K, V> Default for subsoil::std::collections::btree_map::Values<'_, K, V>
impl<K, V> Default for subsoil::std::collections::btree_map::ValuesMut<'_, K, V>
impl<K, V> Default for std::collections::hash::map::IntoIter<K, V>
impl<K, V> Default for std::collections::hash::map::IntoKeys<K, V>
impl<K, V> Default for std::collections::hash::map::IntoValues<K, V>
impl<K, V> Default for std::collections::hash::map::Iter<'_, K, V>
impl<K, V> Default for std::collections::hash::map::IterMut<'_, K, V>
impl<K, V> Default for std::collections::hash::map::Keys<'_, K, V>
impl<K, V> Default for std::collections::hash::map::Values<'_, K, V>
impl<K, V> Default for std::collections::hash::map::ValuesMut<'_, K, V>
impl<K, V> Default for AHashMap<K, V>
compile-time-rng or runtime-rng or no-rng only.NOTE: For safety this trait impl is only available if either of the flags runtime-rng (on by default) or
compile-time-rng are enabled. This is to prevent weakly keyed maps from being accidentally created. Instead one of
constructors for RandomState must be used.
impl<K, V> Default for hashbrown::map::Iter<'_, K, V>
impl<K, V> Default for hashbrown::map::IterMut<'_, K, V>
impl<K, V> Default for hashbrown::map::Keys<'_, K, V>
impl<K, V> Default for hashbrown::map::Values<'_, K, V>
impl<K, V> Default for hashbrown::map::ValuesMut<'_, K, V>
impl<K, V, A> Default for subsoil::std::collections::btree_map::IntoIter<K, V, A>
impl<K, V, A> Default for subsoil::std::collections::btree_map::IntoKeys<K, V, A>
impl<K, V, A> Default for subsoil::std::collections::btree_map::IntoValues<K, V, A>
impl<K, V, A> Default for hashbrown::map::IntoIter<K, V, A>where
A: Allocator,
impl<K, V, A> Default for hashbrown::map::IntoKeys<K, V, A>where
A: Allocator,
impl<K, V, A> Default for hashbrown::map::IntoValues<K, V, A>where
A: Allocator,
impl<K, V, L, S> Default for LruMap<K, V, L, S>
impl<K, V, S> Default for BoundedBTreeMap<K, V, S>
impl<K, V, S> Default for std::collections::hash::map::HashMap<K, V, S>where
S: Default,
impl<K, V, S, A> Default for hashbrown::map::HashMap<K, V, S, A>
impl<K, V, S, A> Default for hashbrown::map::HashMap<K, V, S, A>
impl<L> Default for subsoil::trie::Recorder<L>where
L: TrieLayout,
impl<O> Default for F32<O>
impl<O> Default for F64<O>
impl<O> Default for I16<O>
impl<O> Default for I32<O>
impl<O> Default for I64<O>
impl<O> Default for I128<O>
impl<O> Default for Isize<O>
impl<O> Default for U16<O>
impl<O> Default for U32<O>
impl<O> Default for U64<O>
impl<O> Default for zerocopy::byteorder::U128<O>
impl<O> Default for Usize<O>
impl<P> Default for MaybeDangling<P>
impl<R> Default for DebugAbbrev<R>where
R: Default,
impl<R> Default for DebugAddr<R>where
R: Default,
impl<R> Default for DebugAranges<R>where
R: Default,
impl<R> Default for Dwarf<R>where
R: Default,
impl<R> Default for RangeIter<R>where
R: Reader,
impl<R> Default for DebugCuIndex<R>where
R: Default,
impl<R> Default for DebugTuIndex<R>where
R: Default,
impl<R> Default for DebugLine<R>where
R: Default,
impl<R> Default for DebugLoc<R>where
R: Default,
impl<R> Default for DebugLocLists<R>where
R: Default,
impl<R> Default for LocationLists<R>where
R: Default,
impl<R> Default for DebugMacinfo<R>where
R: Default,
impl<R> Default for DebugMacro<R>where
R: Default,
impl<R> Default for DebugRanges<R>where
R: Default,
impl<R> Default for DebugRngLists<R>where
R: Default,
impl<R> Default for RangeLists<R>where
R: Default,
impl<R> Default for DebugLineStr<R>where
R: Default,
impl<R> Default for DebugStr<R>where
R: Default,
impl<R> Default for DebugStrOffsets<R>where
R: Default,
impl<R> Default for DebugInfo<R>where
R: Default,
impl<R> Default for DebugTypes<R>where
R: Default,
impl<R, G, T> Default for ReentrantMutex<R, G, T>
impl<R, T> Default for lock_api::mutex::Mutex<R, T>
impl<R, T> Default for lock_api::rwlock::RwLock<R, T>
impl<S> Default for Layer<S>
impl<SE: SignedExtension + Default> Default for AsTransactionExtension<SE>
impl<St> Default for SelectAll<St>
impl<T> Default for &[T]
impl<T> Default for &mut [T]
impl<T> Default for Option<T>
impl<T> Default for CfaRule<T>where
T: ReaderOffset,
impl<T> Default for [T; 0]
impl<T> Default for [T; 1]where
T: Default,
impl<T> Default for [T; 2]where
T: Default,
impl<T> Default for [T; 3]where
T: Default,
impl<T> Default for [T; 4]where
T: Default,
impl<T> Default for [T; 5]where
T: Default,
impl<T> Default for [T; 6]where
T: Default,
impl<T> Default for [T; 7]where
T: Default,
impl<T> Default for [T; 8]where
T: Default,
impl<T> Default for [T; 9]where
T: Default,
impl<T> Default for [T; 10]where
T: Default,
impl<T> Default for [T; 11]where
T: Default,
impl<T> Default for [T; 12]where
T: Default,
impl<T> Default for [T; 13]where
T: Default,
impl<T> Default for [T; 14]where
T: Default,
impl<T> Default for [T; 15]where
T: Default,
impl<T> Default for [T; 16]where
T: Default,
impl<T> Default for [T; 17]where
T: Default,
impl<T> Default for [T; 18]where
T: Default,
impl<T> Default for [T; 19]where
T: Default,
impl<T> Default for [T; 20]where
T: Default,
impl<T> Default for [T; 21]where
T: Default,
impl<T> Default for [T; 22]where
T: Default,
impl<T> Default for [T; 23]where
T: Default,
impl<T> Default for [T; 24]where
T: Default,
impl<T> Default for [T; 25]where
T: Default,
impl<T> Default for [T; 26]where
T: Default,
impl<T> Default for [T; 27]where
T: Default,
impl<T> Default for [T; 28]where
T: Default,
impl<T> Default for [T; 29]where
T: Default,
impl<T> Default for [T; 30]where
T: Default,
impl<T> Default for [T; 31]where
T: Default,
impl<T> Default for [T; 32]where
T: Default,
impl<T> Default for *const T
impl<T> Default for *mut T
impl<T> Default for (T₁, T₂, …, Tₙ)where
T: Default,
This trait is implemented for tuples up to twelve items long.
impl<T> Default for IdentityLookup<T>
impl<T> Default for Cell<T>where
T: Default,
impl<T> Default for LazyCell<T>where
T: Default,
impl<T> Default for subsoil::std::cell::OnceCell<T>
impl<T> Default for RefCell<T>where
T: Default,
impl<T> Default for SyncUnsafeCell<T>where
T: Default,
impl<T> Default for UnsafeCell<T>where
T: Default,
impl<T> Default for BTreeSet<T>
impl<T> Default for subsoil::std::collections::btree_set::Iter<'_, T>
impl<T> Default for subsoil::std::collections::btree_set::Range<'_, T>
impl<T> Default for subsoil::std::collections::vec_deque::Iter<'_, T>
impl<T> Default for subsoil::std::collections::vec_deque::IterMut<'_, T>
impl<T> Default for VecDeque<T>
impl<T> Default for subsoil::std::iter::Empty<T>
impl<T> Default for PhantomContravariant<T>where
T: ?Sized,
impl<T> Default for PhantomCovariant<T>where
T: ?Sized,
impl<T> Default for PhantomData<T>where
T: ?Sized,
impl<T> Default for PhantomInvariant<T>where
T: ?Sized,
impl<T> Default for ManuallyDrop<T>
impl<T> Default for Saturating<T>where
T: Default,
impl<T> Default for Wrapping<T>where
T: Default,
impl<T> Default for subsoil::std::prelude::Box<[T]>
no_global_oom_handling only.impl<T> Default for subsoil::std::prelude::Box<T>where
T: Default,
no_global_oom_handling only.impl<T> Default for Reverse<T>where
T: Default,
impl<T> Default for subsoil::std::prelude::Vec<T>
impl<T> Default for Rc<[T]>
no_global_oom_handling only.impl<T> Default for Rc<T>where
T: Default,
no_global_oom_handling only.impl<T> Default for subsoil::std::rc::Weak<T>
impl<T> Default for subsoil::std::slice::Iter<'_, T>
impl<T> Default for subsoil::std::slice::IterMut<'_, T>
impl<T> Default for Atomic<*mut T>
target_has_atomic_load_store=ptr only.impl<T> Default for subsoil::std::sync::nonpoison::Mutex<T>where
T: Default,
impl<T> Default for subsoil::std::sync::nonpoison::RwLock<T>where
T: Default,
impl<T> Default for Arc<[T]>
no_global_oom_handling only.impl<T> Default for Arc<T>where
T: Default,
no_global_oom_handling only.impl<T> Default for Exclusive<T>
impl<T> Default for LazyLock<T>where
T: Default,
impl<T> Default for subsoil::std::sync::Mutex<T>where
T: Default,
impl<T> Default for OnceLock<T>
impl<T> Default for ReentrantLock<T>where
T: Default,
impl<T> Default for subsoil::std::sync::RwLock<T>where
T: Default,
impl<T> Default for subsoil::std::sync::Weak<T>
impl<T> Default for BinaryHeap<T>
impl<T> Default for alloc::collections::binary_heap::IntoIter<T>
impl<T> Default for alloc::collections::binary_heap::Iter<'_, T>
impl<T> Default for alloc::collections::linked_list::IntoIter<T>
impl<T> Default for alloc::collections::linked_list::Iter<'_, T>
impl<T> Default for alloc::collections::linked_list::IterMut<'_, T>
impl<T> Default for LinkedList<T>
impl<T> Default for AssertUnwindSafe<T>where
T: Default,
impl<T> Default for Pin<Box<T>>
no_global_oom_handling only.impl<T> Default for Pin<Rc<T>>
no_global_oom_handling only.impl<T> Default for Pin<Arc<T>>
no_global_oom_handling only.impl<T> Default for UnsafePinned<T>where
T: Default,
impl<T> Default for std::io::cursor::Cursor<T>where
T: Default,
impl<T> Default for AHashSet<T>
compile-time-rng or runtime-rng or no-rng only.NOTE: For safety this trait impl is only available available if either of the flags runtime-rng (on by default) or
compile-time-rng are enabled. This is to prevent weakly keyed maps from being accidentally created. Instead one of
constructors for RandomState must be used.
impl<T> Default for allocator_api2::stable::boxed::Box<T>where
T: Default,
no_global_oom_handling only.impl<T> Default for allocator_api2::stable::vec::Vec<T>
impl<T> Default for HmacEngine<T>where
T: Hash,
impl<T> Default for Hash<T>where
T: Tag,
impl<T> Default for CoreWrapper<T>where
T: Default + BufferKindUser,
<T as BlockSizeUser>::BlockSize: IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>> + Default,
<<T as BlockSizeUser>::BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero,
<T as BufferKindUser>::BufferKind: Default,
impl<T> Default for XofReaderCoreWrapper<T>where
T: Default + XofReaderCore,
<T as BlockSizeUser>::BlockSize: IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>> + Default,
<<T as BlockSizeUser>::BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero,
impl<T> Default for futures_util::io::cursor::Cursor<T>where
T: Default,
impl<T> Default for futures_util::lock::mutex::Mutex<T>where
T: Default,
impl<T> Default for DwarfPackageSections<T>where
T: Default,
impl<T> Default for DwarfSections<T>where
T: Default,
impl<T> Default for hashbrown::table::Iter<'_, T>
impl<T> Default for IterHash<'_, T>
impl<T> Default for IterHashMut<'_, T>
impl<T> Default for hashbrown::table::IterMut<'_, T>
impl<T> Default for NoHashHasher<T>
impl<T> Default for SymbolMap<T>where
T: Default + SymbolMapEntry,
impl<T> Default for OnceBox<T>
impl<T> Default for once_cell::sync::Lazy<T>where
T: Default,
impl<T> Default for once_cell::sync::OnceCell<T>
impl<T> Default for once_cell::unsync::Lazy<T>where
T: Default,
impl<T> Default for once_cell::unsync::OnceCell<T>
impl<T> Default for IndexMap<T>where
T: Default,
impl<T> Default for MemStore<T>
impl<T> Default for Interner<T>where
T: Ord,
impl<T> Default for Path<T>where
T: Form,
impl<T> Default for Pool<T>
impl<T> Default for sharded_slab::Slab<T>
impl<T> Default for slab::Slab<T>
impl<T> Default for CachedThreadLocal<T>where
T: Send,
impl<T> Default for ThreadLocal<T>where
T: Send,
impl<T> Default for TrieRoot<T>where
T: TrieLayout,
impl<T> Default for TrieRootPrint<T>where
T: TrieLayout,
std only.