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 AsciiChar
impl Default for tenderdash_proto::tenderdash_grpc::abci::CheckTxType
impl Default for tenderdash_proto::tenderdash_grpc::abci::MisbehaviorType
impl Default for tenderdash_proto::tenderdash_grpc::abci::response_apply_snapshot_chunk::Result
impl Default for tenderdash_proto::tenderdash_grpc::abci::response_offer_snapshot::Result
impl Default for tenderdash_proto::tenderdash_grpc::abci::response_process_proposal::ProposalStatus
impl Default for tenderdash_proto::tenderdash_grpc::abci::response_verify_vote_extension::VerifyStatus
impl Default for tenderdash_proto::tenderdash_grpc::abci::tx_record::TxAction
impl Default for tenderdash_proto::tenderdash_grpc::types::BlockIdFlag
impl Default for tenderdash_proto::tenderdash_grpc::types::SignedMsgType
impl Default for tenderdash_proto::tenderdash_grpc::types::VoteExtensionType
impl Default for tenderdash_proto::tenderdash_grpc::types::version_params::ConsensusVersion
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::CheckTxType
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::MisbehaviorType
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::response_apply_snapshot_chunk::Result
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::response_offer_snapshot::Result
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::response_process_proposal::ProposalStatus
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::response_verify_vote_extension::VerifyStatus
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::tx_record::TxAction
impl Default for tenderdash_proto::tenderdash_grpc_client::types::BlockIdFlag
impl Default for tenderdash_proto::tenderdash_grpc_client::types::SignedMsgType
impl Default for tenderdash_proto::tenderdash_grpc_client::types::VoteExtensionType
impl Default for tenderdash_proto::tenderdash_grpc_client::types::version_params::ConsensusVersion
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 tenderdash_proto::google::protobuf::Duration
impl Default for Timestamp
impl Default for Global
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 Arc<str>
no_global_oom_handling only.impl Default for Arc<CStr>
no_global_oom_handling only.impl Default for Error
impl Default for FormattingOptions
impl Default for SipHasher
impl Default for PhantomPinned
impl Default for RangeFull
impl Default for Alignment
Returns Alignment::MIN, which is valid for any type.
impl Default for AtomicBool
target_has_atomic_load_store=8 only.impl Default for AtomicI8
impl Default for AtomicI16
impl Default for AtomicI32
impl Default for AtomicI64
impl Default for AtomicIsize
impl Default for AtomicU8
impl Default for AtomicU16
impl Default for AtomicU32
impl Default for AtomicU64
impl Default for AtomicUsize
impl Default for core::time::Duration
impl Default for System
impl Default for OsString
impl Default for FileTimes
impl Default for DefaultHasher
impl Default for RandomState
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 std::sync::nonpoison::condvar::Condvar
impl Default for std::sync::poison::condvar::Condvar
impl Default for DateTime<FixedOffset>
impl Default for DateTime<Utc>
impl Default for chrono::format::parsed::Parsed
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 Buffer
impl Default for IgnoredAny
impl Default for Base64
impl Default for Hex
impl Default for subtle_encoding::identity::Identity
impl Default for Box<str>
no_global_oom_handling only.impl Default for Box<CStr>
impl Default for Box<OsStr>
impl Default for String
impl Default for tenderdash_proto::tenderdash_grpc::abci::CommitInfo
impl Default for tenderdash_proto::tenderdash_grpc::abci::Event
impl Default for tenderdash_proto::tenderdash_grpc::abci::EventAttribute
impl Default for tenderdash_proto::tenderdash_grpc::abci::ExecTxResult
impl Default for tenderdash_proto::tenderdash_grpc::abci::ExtendVoteExtension
impl Default for tenderdash_proto::tenderdash_grpc::abci::ExtendedVoteInfo
impl Default for tenderdash_proto::tenderdash_grpc::abci::Misbehavior
impl Default for tenderdash_proto::tenderdash_grpc::abci::QuorumHashUpdate
impl Default for tenderdash_proto::tenderdash_grpc::abci::Request
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestApplySnapshotChunk
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestCheckTx
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestEcho
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestExtendVote
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestFinalizeBlock
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestFlush
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestInfo
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestInitChain
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestListSnapshots
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestLoadSnapshotChunk
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestOfferSnapshot
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestPrepareProposal
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestProcessProposal
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestQuery
impl Default for tenderdash_proto::tenderdash_grpc::abci::RequestVerifyVoteExtension
impl Default for tenderdash_proto::tenderdash_grpc::abci::Response
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseApplySnapshotChunk
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseCheckTx
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseEcho
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseException
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseExtendVote
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseFinalizeBlock
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseFlush
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseInfo
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseInitChain
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseListSnapshots
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseLoadSnapshotChunk
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseOfferSnapshot
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponsePrepareProposal
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseProcessProposal
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseQuery
impl Default for tenderdash_proto::tenderdash_grpc::abci::ResponseVerifyVoteExtension
impl Default for tenderdash_proto::tenderdash_grpc::abci::Snapshot
impl Default for tenderdash_proto::tenderdash_grpc::abci::ThresholdPublicKeyUpdate
impl Default for tenderdash_proto::tenderdash_grpc::abci::TxRecord
impl Default for tenderdash_proto::tenderdash_grpc::abci::TxResult
impl Default for tenderdash_proto::tenderdash_grpc::abci::Validator
impl Default for tenderdash_proto::tenderdash_grpc::abci::ValidatorSetUpdate
impl Default for tenderdash_proto::tenderdash_grpc::abci::ValidatorUpdate
impl Default for tenderdash_proto::tenderdash_grpc::abci::VoteInfo
impl Default for tenderdash_proto::tenderdash_grpc::crypto::DominoOp
impl Default for tenderdash_proto::tenderdash_grpc::crypto::Proof
impl Default for tenderdash_proto::tenderdash_grpc::crypto::ProofOp
impl Default for tenderdash_proto::tenderdash_grpc::crypto::ProofOps
impl Default for tenderdash_proto::tenderdash_grpc::crypto::PublicKey
impl Default for tenderdash_proto::tenderdash_grpc::crypto::ValueOp
impl Default for tenderdash_proto::tenderdash_grpc::types::AbciParams
impl Default for tenderdash_proto::tenderdash_grpc::types::Block
impl Default for tenderdash_proto::tenderdash_grpc::types::BlockId
impl Default for tenderdash_proto::tenderdash_grpc::types::BlockMeta
impl Default for tenderdash_proto::tenderdash_grpc::types::BlockParams
impl Default for tenderdash_proto::tenderdash_grpc::types::CanonicalBlockId
impl Default for tenderdash_proto::tenderdash_grpc::types::CanonicalPartSetHeader
impl Default for tenderdash_proto::tenderdash_grpc::types::CanonicalProposal
impl Default for tenderdash_proto::tenderdash_grpc::types::CanonicalVote
impl Default for tenderdash_proto::tenderdash_grpc::types::CanonicalVoteExtension
impl Default for tenderdash_proto::tenderdash_grpc::types::Commit
impl Default for tenderdash_proto::tenderdash_grpc::types::ConsensusParams
impl Default for tenderdash_proto::tenderdash_grpc::types::CoreChainLock
impl Default for tenderdash_proto::tenderdash_grpc::types::Data
impl Default for tenderdash_proto::tenderdash_grpc::types::DuplicateVoteEvidence
impl Default for tenderdash_proto::tenderdash_grpc::types::Evidence
impl Default for tenderdash_proto::tenderdash_grpc::types::EvidenceList
impl Default for tenderdash_proto::tenderdash_grpc::types::EvidenceParams
impl Default for tenderdash_proto::tenderdash_grpc::types::HashedParams
impl Default for tenderdash_proto::tenderdash_grpc::types::Header
impl Default for tenderdash_proto::tenderdash_grpc::types::LightBlock
impl Default for tenderdash_proto::tenderdash_grpc::types::Part
impl Default for tenderdash_proto::tenderdash_grpc::types::PartSetHeader
impl Default for tenderdash_proto::tenderdash_grpc::types::Proposal
impl Default for tenderdash_proto::tenderdash_grpc::types::SignedHeader
impl Default for tenderdash_proto::tenderdash_grpc::types::SimpleValidator
impl Default for tenderdash_proto::tenderdash_grpc::types::StateId
impl Default for tenderdash_proto::tenderdash_grpc::types::SynchronyParams
impl Default for tenderdash_proto::tenderdash_grpc::types::TimeoutParams
impl Default for tenderdash_proto::tenderdash_grpc::types::TxProof
impl Default for tenderdash_proto::tenderdash_grpc::types::Validator
impl Default for tenderdash_proto::tenderdash_grpc::types::ValidatorParams
impl Default for tenderdash_proto::tenderdash_grpc::types::ValidatorSet
impl Default for tenderdash_proto::tenderdash_grpc::types::VersionParams
impl Default for tenderdash_proto::tenderdash_grpc::types::Vote
impl Default for tenderdash_proto::tenderdash_grpc::types::VoteExtension
impl Default for tenderdash_proto::tenderdash_grpc::version::Consensus
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::CommitInfo
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::Event
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::EventAttribute
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ExecTxResult
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ExtendVoteExtension
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ExtendedVoteInfo
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::Misbehavior
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::QuorumHashUpdate
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::Request
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestApplySnapshotChunk
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestCheckTx
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestEcho
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestExtendVote
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestFinalizeBlock
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestFlush
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestInfo
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestInitChain
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestListSnapshots
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestLoadSnapshotChunk
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestOfferSnapshot
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestPrepareProposal
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestProcessProposal
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestQuery
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::RequestVerifyVoteExtension
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::Response
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseApplySnapshotChunk
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseCheckTx
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseEcho
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseException
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseExtendVote
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseFinalizeBlock
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseFlush
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseInfo
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseInitChain
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseListSnapshots
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseLoadSnapshotChunk
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseOfferSnapshot
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponsePrepareProposal
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseProcessProposal
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseQuery
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ResponseVerifyVoteExtension
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::Snapshot
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ThresholdPublicKeyUpdate
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::TxRecord
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::TxResult
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::Validator
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ValidatorSetUpdate
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::ValidatorUpdate
impl Default for tenderdash_proto::tenderdash_grpc_client::abci::VoteInfo
impl Default for tenderdash_proto::tenderdash_grpc_client::crypto::DominoOp
impl Default for tenderdash_proto::tenderdash_grpc_client::crypto::Proof
impl Default for tenderdash_proto::tenderdash_grpc_client::crypto::ProofOp
impl Default for tenderdash_proto::tenderdash_grpc_client::crypto::ProofOps
impl Default for tenderdash_proto::tenderdash_grpc_client::crypto::PublicKey
impl Default for tenderdash_proto::tenderdash_grpc_client::crypto::ValueOp
impl Default for tenderdash_proto::tenderdash_grpc_client::types::AbciParams
impl Default for tenderdash_proto::tenderdash_grpc_client::types::Block
impl Default for tenderdash_proto::tenderdash_grpc_client::types::BlockId
impl Default for tenderdash_proto::tenderdash_grpc_client::types::BlockMeta
impl Default for tenderdash_proto::tenderdash_grpc_client::types::BlockParams
impl Default for tenderdash_proto::tenderdash_grpc_client::types::CanonicalBlockId
impl Default for tenderdash_proto::tenderdash_grpc_client::types::CanonicalPartSetHeader
impl Default for tenderdash_proto::tenderdash_grpc_client::types::CanonicalProposal
impl Default for tenderdash_proto::tenderdash_grpc_client::types::CanonicalVote
impl Default for tenderdash_proto::tenderdash_grpc_client::types::CanonicalVoteExtension
impl Default for tenderdash_proto::tenderdash_grpc_client::types::Commit
impl Default for tenderdash_proto::tenderdash_grpc_client::types::ConsensusParams
impl Default for tenderdash_proto::tenderdash_grpc_client::types::CoreChainLock
impl Default for tenderdash_proto::tenderdash_grpc_client::types::Data
impl Default for tenderdash_proto::tenderdash_grpc_client::types::DuplicateVoteEvidence
impl Default for tenderdash_proto::tenderdash_grpc_client::types::Evidence
impl Default for tenderdash_proto::tenderdash_grpc_client::types::EvidenceList
impl Default for tenderdash_proto::tenderdash_grpc_client::types::EvidenceParams
impl Default for tenderdash_proto::tenderdash_grpc_client::types::HashedParams
impl Default for tenderdash_proto::tenderdash_grpc_client::types::Header
impl Default for tenderdash_proto::tenderdash_grpc_client::types::LightBlock
impl Default for tenderdash_proto::tenderdash_grpc_client::types::Part
impl Default for tenderdash_proto::tenderdash_grpc_client::types::PartSetHeader
impl Default for tenderdash_proto::tenderdash_grpc_client::types::Proposal
impl Default for tenderdash_proto::tenderdash_grpc_client::types::SignedHeader
impl Default for tenderdash_proto::tenderdash_grpc_client::types::SimpleValidator
impl Default for tenderdash_proto::tenderdash_grpc_client::types::StateId
impl Default for tenderdash_proto::tenderdash_grpc_client::types::SynchronyParams
impl Default for tenderdash_proto::tenderdash_grpc_client::types::TimeoutParams
impl Default for tenderdash_proto::tenderdash_grpc_client::types::TxProof
impl Default for tenderdash_proto::tenderdash_grpc_client::types::Validator
impl Default for tenderdash_proto::tenderdash_grpc_client::types::ValidatorParams
impl Default for tenderdash_proto::tenderdash_grpc_client::types::ValidatorSet
impl Default for tenderdash_proto::tenderdash_grpc_client::types::VersionParams
impl Default for tenderdash_proto::tenderdash_grpc_client::types::Vote
impl Default for tenderdash_proto::tenderdash_grpc_client::types::VoteExtension
impl Default for tenderdash_proto::tenderdash_grpc_client::version::Consensus
impl Default for AnyDelimiterCodec
impl Default for AtomicWaker
impl Default for AtomicWaker
impl Default for Body
impl Default for Body
impl Default for BufferSettings
impl Default for Builder
impl Default for Builder
impl Default for Builder
impl Default for Builder
impl Default for Builder
impl Default for Builder
impl Default for Bytes
impl Default for BytesCodec
impl Default for BytesMut
impl Default for CancellationToken
impl Default for CompleteOnResponse
impl Default for Count
impl Default for Day
Creates a modifier that indicates the value is padded with zeroes.
impl Default for DefaultHashBuilder
impl Default for Dispatch
impl Default for Duration
impl Default for EnabledCompressionEncodings
impl Default for End
Creates a modifier used to represent the end of input.
impl Default for Event
impl Default for Extensions
impl Default for FinderBuilder
impl Default for FnvHasher
impl Default for FormatterOptions
impl Default for GeneralPurposeConfig
impl Default for HasherRng
impl Default for Hour
Creates a modifier that indicates the value is padded with zeroes and has the 24-hour representation.
impl Default for Identity
impl Default for InvalidFormContentType
impl Default for InvalidMetadataKey
impl Default for KeepAlive
impl Default for LengthDelimitedCodec
impl Default for LinesCodec
impl Default for LoadShedLayer
impl Default for LocalSet
impl Default for MetadataMap
impl Default for Method
impl Default for Minute
Creates a modifier that indicates the value is padded with zeroes.
impl Default for MissedTickBehavior
impl Default for MissingPathParams
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 MonthRepr
Creates a modifier that indicates the value uses the
Numerical representation.
impl Default for NestedPathRejection
impl Default for NoSubscriber
impl Default for Notify
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 OnceBool
impl Default for OnceNonZeroUsize
impl Default for OpenOptions
impl Default for Ordinal
Creates a modifier that indicates the value is padded with zeroes.
impl Default for Overloaded
impl Default for Padding
Creates a modifier that indicates the value is padded with zeroes.
impl Default for Parsed
impl Default for ParserConfig
impl Default for Parts
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 PollNext
impl Default for PrefilterConfig
impl Default for RecoverErrorLayer
impl Default for Routes
impl Default for RoutesBuilder
impl Default for Second
Creates a modifier that indicates the value is padded with zeroes.
impl Default for Server
impl Default for ServiceBuilder<Identity>
impl Default for SingleMessageCompressionOverride
impl Default for SizeHint
impl Default for StatusCode
impl Default for Subsecond
Creates a modifier that indicates the stringified value contains one or more digits.
impl Default for SubsecondDigits
Creates a modifier that indicates the stringified value contains one or more digits.
impl Default for TokioExecutor
impl Default for TokioTimer
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 UnixTimestampPrecision
Creates a modifier that indicates the value represents the number of seconds since the Unix epoch.
impl Default for Uri
Returns a Uri representing /
impl Default for Version
impl Default for WeekNumber
Creates a modifier that indicates that the value is padded with zeroes
and uses the Iso representation.
impl Default for WeekNumberRepr
Creates a modifier that indicates that the value 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 WeekdayRepr
Creates a modifier that indicates the value uses the Long representation.
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 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<'a> Default for &'a ByteStr
impl<'a> Default for &'a mut ByteStr
impl<'a> Default for PhantomContravariantLifetime<'a>
impl<'a> Default for PhantomCovariantLifetime<'a>
impl<'a> Default for PhantomInvariantLifetime<'a>
impl<'a, K, V> Default for alloc::collections::btree::map::Iter<'a, K, V>where
K: 'a,
V: 'a,
impl<'a, K, V> Default for alloc::collections::btree::map::IterMut<'a, K, V>where
K: 'a,
V: 'a,
impl<'a, T> Default for OnceRef<'a, T>
impl<A> Default for SmallVec<A>where
A: Array,
impl<A, B> Default for Chain<A, B>
impl<B> Default for Cow<'_, B>
impl<B> Default for Collected<B>
impl<D> Default for 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<D, Req> Default for MakeBalanceLayer<D, Req>
impl<E> Default for Builder<E>where
E: Default,
impl<F> Default for OptionFuture<F>
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<Idx> Default for core::ops::range::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 Iter<'_, K>
impl<K, A> Default for IntoIter<K, A>where
A: Allocator,
impl<K, S, Req> Default for ReadyCache<K, S, Req>
impl<K, V> Default for &Slice<K, V>
impl<K, V> Default for &mut Slice<K, V>
impl<K, V> Default for BTreeMap<K, V>
impl<K, V> Default for alloc::collections::btree::map::Keys<'_, K, V>
impl<K, V> Default for alloc::collections::btree::map::Range<'_, K, V>
impl<K, V> Default for RangeMut<'_, K, V>
impl<K, V> Default for alloc::collections::btree::map::Values<'_, K, V>
impl<K, V> Default for alloc::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 Box<Slice<K, V>>
impl<K, V> Default for IntoIter<K, V>
impl<K, V> Default for IntoKeys<K, V>
impl<K, V> Default for IntoValues<K, V>
impl<K, V> Default for Iter<'_, K, V>
impl<K, V> Default for Iter<'_, K, V>
impl<K, V> Default for IterMut2<'_, K, V>
impl<K, V> Default for IterMut<'_, K, V>
impl<K, V> Default for IterMut<'_, K, V>
impl<K, V> Default for Keys<'_, K, V>
impl<K, V> Default for Keys<'_, K, V>
impl<K, V> Default for StreamMap<K, V>
impl<K, V> Default for Values<'_, K, V>
impl<K, V> Default for Values<'_, K, V>
impl<K, V> Default for ValuesMut<'_, K, V>
impl<K, V> Default for ValuesMut<'_, K, V>
impl<K, V, A> Default for alloc::collections::btree::map::IntoIter<K, V, A>
impl<K, V, A> Default for alloc::collections::btree::map::IntoKeys<K, V, A>
impl<K, V, A> Default for alloc::collections::btree::map::IntoValues<K, V, A>
impl<K, V, A> Default for IntoIter<K, V, A>where
A: Allocator,
impl<K, V, A> Default for IntoKeys<K, V, A>where
A: Allocator,
impl<K, V, A> Default for IntoValues<K, V, A>where
A: Allocator,
impl<K, V, S> Default for std::collections::hash::map::HashMap<K, V, S>where
S: Default,
impl<K, V, S> Default for IndexMap<K, V, S>where
S: Default,
impl<K, V, S, A> Default for HashMap<K, V, S, A>
impl<S> Default for Router<S>
impl<S> Default for State<S>where
S: Default,
impl<S, E> Default for MethodRouter<S, E>where
S: Clone,
impl<St> Default for SelectAll<St>where
St: Stream + Unpin,
impl<T> Default for &[T]
impl<T> Default for &Slice<T>
impl<T> Default for &mut [T]
impl<T> Default for Option<T>
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 BinaryHeap<T>where
T: Ord,
impl<T> Default for alloc::collections::binary_heap::IntoIter<T>
impl<T> Default for alloc::collections::binary_heap::Iter<'_, T>
impl<T> Default for BTreeSet<T>
impl<T> Default for alloc::collections::btree::set::Iter<'_, T>
impl<T> Default for alloc::collections::btree::set::Range<'_, 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 VecDeque<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 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 alloc::sync::Weak<T>
impl<T> Default for LazyCell<T>where
T: Default,
impl<T> Default for core::cell::once::OnceCell<T>
impl<T> Default for Cell<T>where
T: Default,
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 Reverse<T>where
T: Default,
impl<T> Default for core::iter::sources::empty::Empty<T>
impl<T> Default for PhantomData<T>where
T: ?Sized,
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 ManuallyDrop<T>
impl<T> Default for Saturating<T>where
T: Default,
impl<T> Default for Wrapping<T>where
T: Default,
impl<T> Default for AssertUnwindSafe<T>where
T: Default,
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 Pin<Box<T>>
no_global_oom_handling only.impl<T> Default for UnsafePinned<T>where
T: Default,
impl<T> Default for core::slice::iter::Iter<'_, T>
impl<T> Default for core::slice::iter::IterMut<'_, T>
impl<T> Default for AtomicPtr<T>
target_has_atomic_load_store=ptr only.impl<T> Default for Exclusive<T>
impl<T> Default for std::io::cursor::Cursor<T>where
T: Default,
impl<T> Default for LazyLock<T>where
T: Default,
impl<T> Default for std::sync::nonpoison::mutex::Mutex<T>
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>
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 ProstEncoder<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.