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 (const: unstable) · 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".
Implementors§
impl Default for &'static HtmlStr
impl Default for &otter_nodejs_tests::tera::Value
impl Default for &str
impl Default for &OsStr
impl Default for &CStr
impl Default for &DataLocale
impl Default for &DataMarkerAttributes
impl Default for &mut str
impl Default for AggregatedIE
impl Default for AssetUrlKey
impl Default for otter_nodejs_tests::BigEndian
impl Default for otter_nodejs_tests::LittleEndian
impl Default for OccultationKindGeneral<(OccDisplacement, ZCoord)>
impl Default for PathResolveContext
impl Default for PathResolveMethod
impl Default for PieceAngle
impl Default for PieceMoveable
impl Default for PresentationLayout
impl Default for ProgressUpdateMode
impl Default for Target
impl Default for TimestampPrecision
The default timestamp precision is seconds.
impl Default for WriteStyle
impl Default for ErrorChannel
impl Default for Abi
impl Default for PieceLabelPlace
impl Default for otter_nodejs_tests::progress::Value
impl Default for BytesMode
impl Default for otter_nodejs_tests::tera::Value
The default value is Value::Null.
This is useful for handling omitted Value fields when deserializing.
§Examples
use serde_json::Value;
#[derive(Deserialize)]
struct Settings {
level: i32,
#[serde(default)]
extras: Value,
}
let data = r#" { "level": 42 } "#;
let s: Settings = serde_json::from_str(data)?;
assert_eq!(s.level, 42);
assert_eq!(s.extras, Value::Null);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 LineEnding
impl Default for Tz
Returns Tz::UTC.
impl Default for PollNext
impl Default for DwarfFileType
impl Default for RunTimeEndian
impl Default for Pointer
impl Default for BaseUnit
impl Default for Kilo
impl Default for CollationCaseFirst
impl Default for CollationNumericOrdering
impl Default for CurrencyFormatStyle
impl Default for EmojiPresentationStyle
impl Default for SentenceBreakSupressions
impl Default for BidiPairedBracketType
impl Default for CompressionType
impl Default for image::codecs::png::FilterType
impl Default for DynamicImage
impl Default for IpNet
impl Default for PrefilterConfig
impl Default for Endianness
impl Default for SpecLabels
impl Default for Encoding
impl Default for png::common::Compression
impl Default for AdaptiveFilterType
impl Default for png::filter::FilterType
impl Default for WhichCaptures
impl Default for regex_automata::util::search::MatchKind
impl Default for ExtractKind
impl Default for ColorChoice
The default is Auto.
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 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 YearRepr
Creates a modifier that indicates the value uses the Full representation.
impl Default for MissedTickBehavior
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 otter_nodejs_tests::anyhow::Chain<'_>
std or non-anyhow_no_core_error only.impl Default for HashCache
impl Default for Index
impl Default for Parsed
impl Default for otter_nodejs_tests::chrono::DateTime<FixedOffset>
impl Default for otter_nodejs_tests::chrono::DateTime<Local>
clock only.impl Default for otter_nodejs_tests::chrono::DateTime<Utc>
impl Default for NaiveDate
The default value for a NaiveDate is 1st of January 1970.
§Example
use chrono::NaiveDate;
let default_date = NaiveDate::default();
assert_eq!(default_date, NaiveDate::from_ymd_opt(1970, 1, 1).unwrap());impl Default for NaiveDateTime
The default value for a NaiveDateTime is 1st of January 1970 at 00:00:00.
Note that while this may look like the UNIX epoch, it is missing the
time zone. The actual UNIX epoch cannot be expressed by this type,
however it is available as DateTime::UNIX_EPOCH.
impl Default for NaiveTime
The default value for a NaiveTime is midnight, 00:00:00 exactly.
§Example
use chrono::NaiveTime;
let default_time = NaiveTime::default();
assert_eq!(default_time, NaiveTime::from_hms_opt(0, 0, 0).unwrap());impl Default for TimeDelta
impl Default for WeekdaySet
impl Default for B0
impl Default for B1
impl Default for Equal
impl Default for Greater
impl Default for Less
impl Default for UTerm
impl Default for Z0
impl Default for Eager
impl Default for otter_nodejs_tests::digest::block_buffer::Lazy
impl Default for InvalidBufferSize
impl Default for otter_nodejs_tests::digest::InvalidOutputSize
impl Default for MacError
impl Default for otter_nodejs_tests::env_logger::filter::Builder
impl Default for otter_nodejs_tests::env_logger::Builder
impl Default for DeferredNow
impl Default for FileSpec
impl Default for LogSpecBuilder
impl Default for Error
impl Default for FormattingOptions
impl Default for FileTimes
impl Default for MatchOptions
impl Default for Pattern
impl Default for DefaultHasher
impl Default for RandomState
impl Default for otter_nodejs_tests::humantime::Duration
impl Default for otter_nodejs_tests::io::Empty
impl Default for Sink
impl Default for timespec
impl Default for timeval
impl Default for MetadataBuilder<'_>
impl Default for RecordBuilder<'_>
impl Default for otter_nodejs_tests::materials_format::Version
impl Default for PlHeld
impl Default for PlHist
impl Default for CpuSet
impl Default for Dqblk
impl Default for QuotaValidFlags
impl Default for FdSet
impl Default for UnixCredentials
impl Default for FsFlags
impl Default for OnceBool
impl Default for OnceNonZeroUsize
impl Default for IgnoredAny
impl Default for CompactFormatter
impl Default for Alignment
Returns Alignment::MIN, which is valid for any type.
impl Default for otter_nodejs_tests::parking_lot::Condvar
impl Default for Once
impl Default for ThreadRng
impl Default for OsRng
impl Default for otter_nodejs_tests::regex::bytes::RegexSet
impl Default for otter_nodejs_tests::regex::RegexSet
impl Default for Registry
impl Default for DefaultKey
impl Default for KeyData
impl Default for otter_nodejs_tests::sshkeys::Global
impl Default for Id
impl Default for PerScope
impl Default for AccountId
impl Default for Accounts
impl Default for Arc<str>
no_global_oom_handling only.impl Default for Arc<CStr>
no_global_oom_handling only.impl Default for ClientId
impl Default for ColourSpec
impl Default for CompassAngle
impl Default for otter_nodejs_tests::Condvar
impl Default for otter_nodejs_tests::Duration
impl Default for FaceId
impl Default for FakeRngSpec
impl Default for FakeTimeConfig
impl Default for FakeTimeSpec
impl Default for FastSplitId
impl Default for GOccults
impl Default for GPieces
impl Default for otter_nodejs_tests::Global
impl Default for Html
impl Default for IFastSplits
impl Default for IOccults
impl Default for InstanceBundles
impl Default for LinksTable
impl Default for LogSpecification
impl Default for Notches
impl Default for OccId
impl Default for OccultIlkId
impl Default for OccultIlks
impl Default for PathBuf
impl Default for PerPlayerIdMap
impl Default for PieceAliases
impl Default for PieceId
impl Default for PieceOccult
impl Default for PieceSpecialProperties
impl Default for PlayerId
impl Default for Tera
impl Default for TextOptionsSpec
impl Default for Timezone
impl Default for UrlSpec
impl Default for VisiblePieceId
impl Default for WholeServerConfig
impl Default for ZCoord
impl Default for otter_nodejs_tests::tempfile::Builder<'_, '_>
impl Default for WS
impl Default for Context
impl Default for otter_nodejs_tests::tera::Map<String, Value>
impl Default for otter_nodejs_tests::toml::map::Map<String, Value>
impl Default for UnixSocketAddr
impl Default for otter_nodejs_tests::zipfile::DateTime
impl Default for FileOptions
impl Default for otter_nodejs_tests::inventory::core::hash::SipHasher
impl Default for PhantomPinned
impl Default for RangeFull
impl Default for otter_nodejs_tests::inventory::core::sync::atomic::Atomic<bool>
target_has_atomic_load_store=8 only.impl Default for otter_nodejs_tests::inventory::core::sync::atomic::Atomic<i8>
impl Default for otter_nodejs_tests::inventory::core::sync::atomic::Atomic<i16>
impl Default for otter_nodejs_tests::inventory::core::sync::atomic::Atomic<i32>
impl Default for otter_nodejs_tests::inventory::core::sync::atomic::Atomic<i64>
impl Default for otter_nodejs_tests::inventory::core::sync::atomic::Atomic<isize>
impl Default for otter_nodejs_tests::inventory::core::sync::atomic::Atomic<u8>
impl Default for otter_nodejs_tests::inventory::core::sync::atomic::Atomic<u16>
impl Default for otter_nodejs_tests::inventory::core::sync::atomic::Atomic<u32>
impl Default for otter_nodejs_tests::inventory::core::sync::atomic::Atomic<u64>
impl Default for otter_nodejs_tests::inventory::core::sync::atomic::Atomic<usize>
impl Default for alloc::alloc::Global
impl Default for Box<str>
no_global_oom_handling only.impl Default for Box<OsStr>
impl Default for Box<CStr>
impl Default for Box<BStr>
alloc only.impl Default for ByteString
impl Default for CString
impl Default for Rc<str>
no_global_oom_handling only.impl Default for Rc<CStr>
no_global_oom_handling only.impl Default for String
impl Default for System
impl Default for OsString
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 std::sync::nonpoison::condvar::Condvar
impl Default for std::sync::poison::condvar::Condvar
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 ansi_term::style::Style
impl Default for Backtrace
impl Default for GeneralPurposeConfig
impl Default for Base64Bcrypt
impl Default for Base64Crypt
impl Default for Base64Pbkdf2
impl Default for Base64ShaCrypt
impl Default for Base64
impl Default for Base64Unpadded
impl Default for Base64Url
impl Default for Base64UrlUnpadded
impl Default for BString
impl Default for bytes::bytes::Bytes
impl Default for BytesMut
impl Default for bzip2::Compression
impl Default for console::utils::Style
impl Default for Hasher
impl Default for Collector
impl Default for Backoff
impl Default for Parker
impl Default for WaitGroup
impl Default for digest::errors::InvalidOutputSize
impl Default for Rng
impl Default for fdeflate::decompress::Decompressor
impl Default for Crc
impl Default for GzBuilder
impl Default for GzHeader
impl Default for flate2::Compression
impl Default for FnvHasher
impl Default for AtomicWaker
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 GlobSet
impl Default for h2::client::Builder
impl Default for h2::server::Builder
impl Default for DefaultHashBuilder
impl Default for SizeHint
impl Default for http::extensions::Extensions
impl Default for Method
impl Default for http::request::Builder
impl Default for http::response::Builder
impl Default for StatusCode
impl Default for http::uri::builder::Builder
impl Default for Parts
impl Default for Uri
Returns a Uri representing /
impl Default for http::version::Version
impl Default for ParserConfig
impl Default for FormatSizeOptions
impl Default for Body
impl Default for hyper::client::client::Builder
impl Default for hyper::client::client::Client<HttpConnector>
tcp only.impl Default for DataLocale
impl Default for Other
impl Default for Private
impl Default for icu_locale_core::extensions::Extensions
impl Default for Fields
impl Default for Transform
impl Default for icu_locale_core::extensions::transform::value::Value
impl Default for Attributes
impl Default for Keywords
impl Default for Unicode
impl Default for icu_locale_core::extensions::unicode::value::Value
impl Default for LocalePreferences
impl Default for Variants
impl Default for CanonicalCombiningClassMap
compiled_data only.impl Default for CanonicalCombiningClassMapBorrowed<'static>
compiled_data only.impl Default for CanonicalComposition
compiled_data only.impl Default for CanonicalCompositionBorrowed<'static>
compiled_data only.impl Default for CanonicalDecomposition
compiled_data only.impl Default for CanonicalDecompositionBorrowed<'static>
compiled_data only.impl Default for Uts46Mapper
compiled_data only.impl Default for Uts46MapperBorrowed<'static>
compiled_data only.impl Default for BidiMirroringGlyph
impl Default for GeneralCategoryOutOfBoundsError
impl Default for ScriptWithExtensionsBorrowed<'static>
compiled_data only.impl Default for DataRequestMetadata
impl Default for DataResponseMetadata
impl Default for idna::deprecated::Config
The defaults are that of beStrict=false in the WHATWG URL Standard
impl Default for Idna
impl Default for Errors
impl Default for Uts46
compiled_data only.impl Default for Adapter
compiled_data only.impl Default for PixelDensity
impl Default for LimitSupport
impl Default for image::io::Limits
impl Default for Ipv4Net
impl Default for Ipv6Net
impl Default for itoa::Buffer
impl Default for Md5
impl Default for FinderBuilder
impl Default for CompressorOxide
impl Default for DecompressorOxide
impl Default for InflateState
impl Default for mio_extras::timer::Builder
impl Default for BigInt
impl Default for BigUint
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 Sha1
impl Default for openssl::sha::Sha224
impl Default for openssl::sha::Sha256
impl Default for openssl::sha::Sha384
impl Default for openssl::sha::Sha512
impl Default for AuthorityKeyIdentifier
impl Default for BasicConstraints
impl Default for ExtendedKeyUsage
impl Default for KeyUsage
impl Default for SubjectAlternativeName
impl Default for SubjectKeyIdentifier
impl Default for LabelSpec
impl Default for OccultSpec
impl Default for UnparkResult
impl Default for SpinWait
impl Default for ParamsString
impl Default for Params
impl Default for FrameControl
impl Default for Info<'_>
impl Default for Transformations
Instantiate the default transformations, the identity transform.
impl Default for DecodeOptions
impl Default for StreamingDecoder
impl Default for png::decoder::Limits
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 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 Extractor
impl Default for ClassBytesRange
impl Default for ClassUnicodeRange
impl Default for regex_syntax::hir::LookSet
impl Default for TranslatorBuilder
impl Default for regex_syntax::parser::ParserBuilder
impl Default for reqwest::async_impl::client::Client
impl Default for reqwest::async_impl::client::ClientBuilder
impl Default for reqwest::blocking::client::Client
impl Default for reqwest::blocking::client::ClientBuilder
impl Default for NoProxy
impl Default for Policy
impl Default for ByteBuf
impl Default for ReadFlags
impl Default for WatchFlags
impl Default for ResolveFlags
impl Default for Timespec
impl Default for ryu::buffer::Buffer
impl Default for Flexible
impl Default for Lowercase
impl Default for Padded
impl Default for PreferMany
impl Default for PreferOne
impl Default for Strict
impl Default for Unpadded
impl Default for Uppercase
impl Default for BorrowCow
impl Default for serde_with::Bytes
impl Default for BytesOrString
impl Default for CommaSeparator
impl Default for DisplayFromStr
impl Default for NoneAsEmptyString
impl Default for Same
impl Default for SpaceSeparator
impl Default for Sha1Core
impl Default for sha2::sha256::Sha224
impl Default for sha2::sha256::Sha256
impl Default for sha2::sha512::Sha384
impl Default for sha2::sha512::Sha512
impl Default for Sha512Trunc224
impl Default for Sha512Trunc256
impl Default for Adler32
impl Default for Hash128
impl Default for siphasher::sip128::SipHasher13
impl Default for siphasher::sip128::SipHasher24
impl Default for siphasher::sip128::SipHasher
impl Default for siphasher::sip::SipHasher13
impl Default for siphasher::sip::SipHasher24
impl Default for siphasher::sip::SipHasher
impl Default for ColorSpec
impl Default for time::duration::Duration
impl Default for Day
Creates a modifier that indicates the value is padded with zeroes.
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 uses the + sign for all positive 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 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 AnyDelimiterCodec
impl Default for BytesCodec
impl Default for tokio_util::codec::length_delimited::Builder
impl Default for LengthDelimitedCodec
impl Default for LinesCodec
impl Default for CancellationToken
impl Default for DirBuilder
impl Default for tokio::fs::open_options::OpenOptions
impl Default for tokio::net::unix::pipe::OpenOptions
impl Default for LocalOptions
impl Default for Notify
impl Default for LocalSet
impl Default for Dispatch
impl Default for NoSubscriber
impl Default for zmij::Buffer
impl Default for CCtx<'_>
impl Default for DCtx<'_>
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 BStr
impl<'a> Default for &'a mut ByteStr
impl<'a> Default for &'a mut BStr
impl<'a> Default for Env<'a>
impl<'a> Default for PrettyFormatter<'a>
impl<'a> Default for PhantomContravariantLifetime<'a>
impl<'a> Default for PhantomCovariantLifetime<'a>
impl<'a> Default for PhantomInvariantLifetime<'a>
impl<'a> Default for ArgMatches<'a>
impl<'a> Default for OsValues<'a>
Creates an empty iterator.
impl<'a> Default for clap::args::arg_matches::Values<'a>
Creates an empty iterator.
impl<'a> Default for ArgGroup<'a>
impl<'a> Default for DataIdentifierBorrowed<'a>
impl<'a> Default for DataRequest<'a>
impl<'a> Default for rmp::decode::bytes::Bytes<'a>
impl<'a> Default for Compressor<'a>
impl<'a> Default for zstd::bulk::decompressor::Decompressor<'a>
impl<'a, 'b> Default for Arg<'a, 'b>where
'a: 'b,
impl<'a, K, V> Default for otter_nodejs_tests::btree_map::Iter<'a, K, V>where
K: 'a,
V: 'a,
impl<'a, K, V> Default for otter_nodejs_tests::btree_map::IterMut<'a, K, V>where
K: 'a,
V: 'a,
impl<'a, T> Default for OnceRef<'a, T>
impl<'a, T> Default for ZeroVec<'a, T>where
T: AsULE,
impl<'data> Default for object::read::coff::section::SectionTable<'data>
impl<'data> Default for object::read::elf::version::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<A> Default for RepeatN<A>
Creates an empty iterator, like repeat_n(value, 0)
but without needing any such value at hand.
impl<A> Default for SmallVec<A>where
A: Array,
impl<A, B> Default for otter_nodejs_tests::iter::Chain<A, B>
impl<A, T, E> Default for OpOutcomeThunkGeneric<A, T, E>where
T: Default,
impl<B> Default for Cow<'_, B>
impl<B> Default for Collected<B>
impl<BlockSize> Default for block_buffer::BlockBuffer<BlockSize>
impl<BlockSize, Kind> Default for otter_nodejs_tests::digest::block_buffer::BlockBuffer<BlockSize, Kind>
impl<D> Default for http_body::empty::Empty<D>
impl<D> Default for Full<D>where
D: Buf,
impl<D, E> Default for BoxBody<D, E>where
D: Buf + 'static,
impl<D, E> Default for UnsyncBoxBody<D, E>where
D: Buf + 'static,
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<EntryData> Default for VecList<EntryData>
impl<F> Default for OptionFuture<F>
impl<FORMAT, STRICTNESS> Default for DurationMicroSeconds<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for DurationMicroSecondsWithFrac<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for DurationMilliSeconds<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for DurationMilliSecondsWithFrac<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for DurationNanoSeconds<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for DurationNanoSecondsWithFrac<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for DurationSeconds<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for DurationSecondsWithFrac<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for TimestampMicroSeconds<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for TimestampMicroSecondsWithFrac<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for TimestampMilliSeconds<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for TimestampMilliSecondsWithFrac<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for TimestampNanoSeconds<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for TimestampNanoSecondsWithFrac<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for TimestampSeconds<FORMAT, STRICTNESS>
impl<FORMAT, STRICTNESS> Default for TimestampSecondsWithFrac<FORMAT, STRICTNESS>
impl<Fut> Default for FuturesOrdered<Fut>where
Fut: Future,
impl<Fut> Default for FuturesUnordered<Fut>
impl<H> Default for BuildHasherDefault<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<I, A> Default for Box<IndexSlice<I, [A]>>where
I: Idx,
impl<I, T> Default for &IndexSlice<I, [T]>where
I: Idx,
impl<I, T> Default for &mut IndexSlice<I, [T]>where
I: Idx,
impl<I, T> Default for IndexVec<I, T>where
I: Idx,
impl<Id> Default for TokenRegistry<Id>
impl<Idx> Default for otter_nodejs_tests::inventory::core::ops::Range<Idx>where
Idx: Default,
impl<Idx> Default for otter_nodejs_tests::inventory::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 &indexmap::map::slice::Slice<K, V>
impl<K, V> Default for &mut indexmap::map::slice::Slice<K, V>
impl<K, V> Default for otter_nodejs_tests::btree_map::Keys<'_, K, V>
impl<K, V> Default for otter_nodejs_tests::btree_map::Range<'_, K, V>
impl<K, V> Default for RangeMut<'_, K, V>
impl<K, V> Default for otter_nodejs_tests::btree_map::Values<'_, K, V>
impl<K, V> Default for otter_nodejs_tests::btree_map::ValuesMut<'_, K, V>
impl<K, V> Default for otter_nodejs_tests::hash_map::IntoIter<K, V>
impl<K, V> Default for otter_nodejs_tests::hash_map::IntoKeys<K, V>
impl<K, V> Default for otter_nodejs_tests::hash_map::IntoValues<K, V>
impl<K, V> Default for otter_nodejs_tests::hash_map::Iter<'_, K, V>
impl<K, V> Default for otter_nodejs_tests::hash_map::IterMut<'_, K, V>
impl<K, V> Default for otter_nodejs_tests::hash_map::Keys<'_, K, V>
impl<K, V> Default for otter_nodejs_tests::hash_map::Values<'_, K, V>
impl<K, V> Default for otter_nodejs_tests::hash_map::ValuesMut<'_, K, V>
impl<K, V> Default for HopSlotMap<K, V>where
K: Key,
impl<K, V> Default for SecondaryMap<K, V>where
K: Key,
impl<K, V> Default for SlotMap<K, V>where
K: Key,
impl<K, V> Default for BTreeMap<K, V>
impl<K, V> Default for DenseSlotMap<K, V>where
K: Key,
impl<K, V> Default for EnumMap<K, V>
impl<K, V> Default for Box<Slice<K, V>>
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> Default for indexmap::map::iter::IntoIter<K, V>
impl<K, V> Default for indexmap::map::iter::IntoKeys<K, V>
impl<K, V> Default for indexmap::map::iter::IntoValues<K, V>
impl<K, V> Default for indexmap::map::iter::Iter<'_, K, V>
impl<K, V> Default for IterMut2<'_, K, V>
impl<K, V> Default for indexmap::map::iter::IterMut<'_, K, V>
impl<K, V> Default for indexmap::map::iter::Keys<'_, K, V>
impl<K, V> Default for indexmap::map::iter::Values<'_, K, V>
impl<K, V> Default for indexmap::map::iter::ValuesMut<'_, K, V>
impl<K, V> Default for phf::map::Map<K, V>
impl<K, V, A> Default for otter_nodejs_tests::btree_map::IntoIter<K, V, A>
impl<K, V, A> Default for otter_nodejs_tests::btree_map::IntoKeys<K, V, A>
impl<K, V, A> Default for otter_nodejs_tests::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, S> Default for otter_nodejs_tests::HashMap<K, V, S>where
S: Default,
impl<K, V, S> Default for otter_nodejs_tests::IndexMap<K, V, S>where
S: Default,
impl<K, V, S> Default for SparseSecondaryMap<K, V, S>
impl<K, V, S> Default for indexmap::map::IndexMap<K, V, S>where
S: Default,
impl<K, V, S> Default for LiteMap<K, V, S>
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<M> Default for DataPayload<M>
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 U128<O>
impl<O> Default for Usize<O>
impl<P> Default for MaybeDangling<P>
impl<P> Default for Acl<P>
impl<P> Default for LoadedAcl<P>where
P: Perm,
impl<P, Container> Default for ImageBuffer<P, Container>
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> Default for PrattParser<R>where
R: RuleType,
impl<R, G, T> Default for ReentrantMutex<R, G, T>
impl<R, T> Default for otter_nodejs_tests::parking_lot::lock_api::Mutex<R, T>
impl<R, T> Default for otter_nodejs_tests::parking_lot::lock_api::RwLock<R, T>
impl<S> Default for UniCase<S>
impl<S> Default for BoolFromInt<S>where
S: Default + Strictness,
impl<S> Default for Ascii<S>where
S: Default,
impl<Sep, T> Default for StringWithSeparator<Sep, T>
impl<St> Default for SelectAll<St>
impl<Storage> Default for __BindgenBitfieldUnit<Storage>where
Storage: Default,
impl<Store> Default for ZeroAsciiIgnoreCaseTrie<Store>
impl<Store> Default for ZeroTrieExtendedCapacity<Store>
impl<Store> Default for ZeroTriePerfectHash<Store>
impl<Store> Default for ZeroTrieSimpleAscii<Store>
impl<T> Default for &[T]
impl<T> Default for &indexmap::set::slice::Slice<T>
impl<T> Default for &ZeroSlice<T>where
T: AsULE,
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 otter_nodejs_tests::btree_set::Iter<'_, T>
impl<T> Default for otter_nodejs_tests::btree_set::Range<'_, T>
impl<T> Default for Reverse<T>where
T: Default,
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 otter_nodejs_tests::io::Cursor<T>where
T: Default,
impl<T> Default for otter_nodejs_tests::iter::Empty<T>
impl<T> Default for otter_nodejs_tests::lazy_init::Lazy<T>
impl<T> Default for otter_nodejs_tests::lazy_regex::Lazy<T>where
T: Default,
impl<T> Default for AlgSetKey<T>
impl<T> Default for OnceBox<T>
impl<T> Default for otter_nodejs_tests::once_cell::sync::OnceCell<T>
impl<T> Default for otter_nodejs_tests::once_cell::unsync::Lazy<T>where
T: Default,
impl<T> Default for otter_nodejs_tests::once_cell::unsync::OnceCell<T>
impl<T> Default for NotNan<T>where
T: Default,
impl<T> Default for ManuallyDrop<T>
impl<T> Default for otter_nodejs_tests::otter_support::debugmutex::Mutex<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 BTreeSet<T>
impl<T> Default for OrderedFloat<T>where
T: Default,
impl<T> Default for PhantomData<T>where
T: ?Sized,
impl<T> Default for VecDeque<T>
impl<T> Default for Wrapping<T>where
T: Default,
impl<T> Default for Cell<T>where
T: Default,
impl<T> Default for otter_nodejs_tests::inventory::core::cell::LazyCell<T>where
T: Default,
impl<T> Default for otter_nodejs_tests::inventory::core::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 PhantomContravariant<T>where
T: ?Sized,
impl<T> Default for PhantomCovariant<T>where
T: ?Sized,
impl<T> Default for PhantomInvariant<T>where
T: ?Sized,
impl<T> Default for Saturating<T>where
T: Default,
impl<T> Default for AssertUnwindSafe<T>where
T: Default,
impl<T> Default for Pin<Arc<T>>
no_global_oom_handling only.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 UnsafePinned<T>where
T: Default,
impl<T> Default for otter_nodejs_tests::inventory::core::slice::Iter<'_, T>
impl<T> Default for otter_nodejs_tests::inventory::core::slice::IterMut<'_, T>
impl<T> Default for otter_nodejs_tests::inventory::core::sync::atomic::Atomic<*mut T>
target_has_atomic_load_store=ptr only.impl<T> Default for SyncView<T>where
T: Default,
impl<T> Default for Box<[T]>
no_global_oom_handling only.impl<T> Default for Box<Slice<T>>
impl<T> Default for Box<T>where
T: Default,
no_global_oom_handling only.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 alloc::collections::vec_deque::iter::Iter<'_, T>
impl<T> Default for alloc::collections::vec_deque::iter_mut::IterMut<'_, 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 alloc::rc::Weak<T>
impl<T> Default for alloc::sync::Weak<T>
impl<T> Default for Vec<T>
impl<T> Default for LazyLock<T>where
T: Default,
impl<T> Default for std::sync::nonpoison::mutex::Mutex<T>where
T: Default,
impl<T> Default for std::sync::nonpoison::rwlock::RwLock<T>where
T: Default,
impl<T> Default for OnceLock<T>
impl<T> Default for std::sync::poison::mutex::Mutex<T>where
T: Default,
impl<T> Default for std::sync::poison::rwlock::RwLock<T>where
T: Default,
impl<T> Default for ReentrantLock<T>where
T: Default,
impl<T> Default for StreamCipherCoreWrapper<T>where
T: Default + BlockSizeUser,
<T as BlockSizeUser>::BlockSize: IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,
<<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 Injector<T>
impl<T> Default for crossbeam_epoch::atomic::Atomic<T>
impl<T> Default for AtomicCell<T>where
T: Default,
impl<T> Default for CachePadded<T>where
T: Default,
impl<T> Default for ShardedLock<T>where
T: Default,
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 IterBuckets<'_, T>
impl<T> Default for IterHash<'_, T>
impl<T> Default for IterHashBuckets<'_, T>
impl<T> Default for IterHashMut<'_, T>
impl<T> Default for hashbrown::table::IterMut<'_, T>
impl<T> Default for UnsafeIter<'_, T>
impl<T> Default for HeaderMap<T>
impl<T> Default for Request<T>where
T: Default,
impl<T> Default for Response<T>where
T: Default,
impl<T> Default for HttpsConnector<T>where
T: Default,
impl<T> Default for CodePointMapDataBorrowed<'static, T>where
T: EnumeratedProperty,
compiled_data only.impl<T> Default for PropertyNamesLongBorrowed<'static, T>where
T: NamedEnumeratedProperty,
compiled_data only.impl<T> Default for PropertyNamesShortBorrowed<'static, T>where
T: NamedEnumeratedProperty,
compiled_data only.impl<T> Default for PropertyParserBorrowed<'static, T>where
T: ParseableEnumeratedProperty,
compiled_data only.