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 struct
s
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 primitives 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 derive
d, it will use the default value for each field’s type.
§enum
s
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 Disambiguation
impl Default for OffsetConflict
impl Default for DistortionKind
impl Default for Easing
impl Default for StartTime
impl Default for EndPosition
impl Default for PlaybackPosition
impl Default for PrefilterConfig
impl Default for Equation
impl Default for PassAction
impl Default for VertexStep
impl Default for IOURING_OP
impl Default for IoringOp
impl Default for IoringRestrictionOp
impl Default for Limit
impl Default for UpdateKind
impl Default for AngleDirection
geom
only.impl Default for AngleKind
geom
only.impl Default for Sign
impl Default for UnitBi
unit
only.impl Default for UnitSi
unit
only.impl Default for devela::text::AsciiChar
impl Default for devela::_core::ascii::Char
impl Default for EulerRot
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 Global
impl Default for devela::_dep::_std::alloc::System
impl Default for FileTimes
impl Default for DefaultHasher
impl Default for devela::_dep::_std::io::Empty
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 Bump
impl Default for Attributes
impl Default for ContentStyle
impl Default for Date
impl Default for DateTime
impl Default for DateTimeRound
impl Default for ISOWeekDate
impl Default for devela::_dep::jiff::civil::Time
impl Default for TimeRound
impl Default for SpanParser
impl Default for SpanPrinter
impl Default for BrokenDownTime
impl Default for SignedDuration
impl Default for SignedDurationRound
impl Default for Span
impl Default for SpanRound<'static>
impl Default for Timestamp
impl Default for TimestampRound
impl Default for Zoned
impl Default for ZonedRound
impl Default for Collator
impl Default for DateTimeFormat
impl Default for NumberFormat
impl Default for PluralRules
impl Default for RelativeTimeFormat
impl Default for devela::_dep::js_sys::Array
impl Default for BigInt64Array
impl Default for BigInt
impl Default for BigUint64Array
impl Default for Boolean
impl Default for Float32Array
impl Default for Float64Array
impl Default for Function
impl Default for Int8Array
impl Default for Int16Array
impl Default for Int32Array
impl Default for Map
impl Default for Number
impl Default for Object
impl Default for Set
impl Default for Uint8Array
impl Default for Uint8ClampedArray
impl Default for Uint16Array
impl Default for Uint32Array
impl Default for WeakMap
impl Default for WeakSet
impl Default for CpalBackendSettings
impl Default for MockBackendSettings
impl Default for CompressorBuilder
impl Default for DelayBuilder
impl Default for DistortionBuilder
impl Default for FilterBuilder
impl Default for PanningControlBuilder
impl Default for ReverbBuilder
impl Default for VolumeControlBuilder
impl Default for MockInfoBuilder
impl Default for LfoBuilder
impl Default for StaticSoundSettings
impl Default for StreamingSoundSettings
impl Default for Region
impl Default for Capacities
impl Default for Decibels
impl Default for Frame
impl Default for Panning
impl Default for PlaybackRate
impl Default for Semitones
impl Default for Tween
impl Default for MainTrackBuilder
impl Default for SendTrackBuilder
impl Default for SpatialTrackBuilder
impl Default for SpatialTrackDistances
impl Default for TrackBuilder
impl Default for FinderBuilder
impl Default for Conf
impl Default for Platform
impl Default for BufferLayout
impl Default for Features
impl Default for GlslSupport
impl Default for KeyMods
impl Default for PipelineParams
impl Default for TextureParams
impl Default for aio_sigset_t
impl Default for blk_io_trace_remap_t
impl Default for blk_user_trace_setup_t
impl Default for bpf_cgroup_storage_key_t
impl Default for bpf_insn_t
impl Default for bpf_lpm_trie_key_t
impl Default for cachestat_range_t
impl Default for cachestat_t
impl Default for cap_user_data_t
impl Default for cap_user_header_t
impl Default for clone_args_t
impl Default for cmsghdr_t
impl Default for compat_statfs64_t
impl Default for cpu_set_t
impl Default for epoll_event_t
impl Default for f_owner_ex_t
impl Default for fd_set_t
impl Default for fiemap_extent_t
impl Default for fiemap_t
impl Default for file_clone_range_t
impl Default for file_dedupe_range_info_t
impl Default for file_handle_t
impl Default for files_stat_struct_t
impl Default for flock64_t
impl Default for flock_t
impl Default for fscrypt_policy_t
impl Default for fsid_t
impl Default for fstrim_range_t
impl Default for fsxattr_t
impl Default for getcpu_cache_t
impl Default for group_filter_t
impl Default for group_req_t
impl Default for group_source_req_t
impl Default for if_dqblk_t
impl Default for if_dqinfo_t
impl Default for if_nextdqblk_t
impl Default for in6_addr_t
impl Default for in6_flowlabel_req_t
impl Default for in_addr_t
impl Default for in_pktinfo_t
impl Default for inodes_stat_t
impl Default for inotify_event_t
impl Default for io_cqring_offsets_t
impl Default for io_event_t
impl Default for io_file_t
impl Default for io_sqring_offsets_t
impl Default for io_uring_cqe_t
impl Default for io_uring_files_update_t
impl Default for io_uring_params_t
impl Default for io_uring_probe_op_t
impl Default for io_uring_sqe_buf_t
impl Default for io_uring_sqe_t
impl Default for iocb_t
impl Default for iovec_t
impl Default for ip_mreq_source_t
impl Default for ip_mreq_t
impl Default for ip_mreqn_t
impl Default for ip_msfilter_t
impl Default for ipc64_perm_t
impl Default for ipc_perm_t
impl Default for ipv6_mreq_t
impl Default for itimerspec64_t
impl Default for itimerspec_t
impl Default for itimerval_t
impl Default for kcmp_epoll_slot_t
impl Default for kernel_itimerspec_t
impl Default for kernel_sock_timeval_t
impl Default for kernel_sockaddr_storage_t
impl Default for kernel_timespec_t
impl Default for kernel_timex_t
impl Default for kernel_timex_timeval_t
impl Default for kernle_old_timeval_t
impl Default for kexec_segment_t
impl Default for ktermios_t
impl Default for linger_t
impl Default for linux_dirent64_t
impl Default for linux_dirent_t
impl Default for mnt_id_req_t
impl Default for mount_attr_t
impl Default for mq_attr_t
impl Default for msgbuf_t
impl Default for msginfo_t
impl Default for msqid64_ds_t
impl Default for msqid_ds_t
impl Default for new_utsname_t
impl Default for open_how_t
impl Default for pollfd_t
impl Default for prctl_mm_map_t
impl Default for pthread_barrierattr_t
impl Default for pthread_condattr_t
impl Default for pthread_mutexattr_t
impl Default for pthread_rwlockattr_t
impl Default for ptrace_peeksiginfo_args_t
impl Default for ptrace_syscall_info_seccomp_entry_t
impl Default for ptrace_syscall_info_seccomp_exit_t
impl Default for ptrace_syscall_info_seccomp_seccomp_t
impl Default for rlimit64_t
impl Default for rlimit_t
impl Default for rseq_cs_ptr_t
impl Default for rseq_cs_t
impl Default for rusage_t
impl Default for sched_attr_t
impl Default for sched_param_t
impl Default for scm_timestamping_internal_t
impl Default for seccomp_data_t
impl Default for seccomp_metadata_t
impl Default for seccomp_notif_resp_t
impl Default for seccomp_notif_sizes_t
impl Default for seccomp_notif_t
impl Default for sembuf_t
impl Default for semid_ds_t
impl Default for seminfo_t
impl Default for serial_icounter_struct_t
impl Default for serial_iso7816_t
impl Default for serial_multiport_struct_t
impl Default for serial_rs485_t
impl Default for shm_info_t
impl Default for shmid64_ds_t
impl Default for shmid_ds_t
impl Default for shminfo64_t
impl Default for shminfo_t
impl Default for si_kill_t
impl Default for si_rt_t
impl Default for si_sigchld_t
impl Default for si_sigpoll_t
impl Default for si_sigsys_t
impl Default for si_timer_t
impl Default for sigaction_t
impl Default for sigaltstack_t
impl Default for sigev_thread_t
impl Default for sigevent_t
impl Default for siginfo_intern_t
impl Default for sigset_t
impl Default for sockaddr_in6_t
impl Default for sockaddr_in_t
impl Default for sockaddr_t
impl Default for stat_t
impl Default for statfs64_t
impl Default for statfs_t
impl Default for statmount_t
impl Default for statx_t
impl Default for statx_timestamp_t
impl Default for sysinfo_t
impl Default for termio_t
impl Default for termios2_t
impl Default for termios_t
impl Default for timespec64_t
impl Default for timespec_t
impl Default for timeval_t
impl Default for timex_t
impl Default for timezone_t
impl Default for tms_t
impl Default for ucred_t
impl Default for user_desc_t
impl Default for ustat_t
impl Default for utimbuf_t
impl Default for winsize_t
impl Default for PyAsyncMethods
impl Default for PyBufferProcs
impl Default for PyGetSetDef
impl Default for PyHash_FuncDef
impl Default for PyHeapTypeObject
impl Default for PyMappingMethods
impl Default for PyMemberDef
impl Default for PyMethodDef
impl Default for PyModuleDef_Slot
impl Default for PyObjectArenaAllocator
impl Default for PyType_Slot
impl Default for PyType_Spec
impl Default for OsRng
impl Default for CpuId<CpuIdReaderNative>
impl Default for ThreadPoolBuilder
impl Default for Pool
impl Default for Unpool
impl Default for FxHasher64
impl Default for ArchivedIpv4Addr
impl Default for ArchivedIpv6Addr
impl Default for ArchivedSocketAddrV4
impl Default for ArchivedSocketAddrV6
impl Default for ArchivedRangeFull
impl Default for AtomicI16_be
impl Default for AtomicI16_le
impl Default for AtomicI32_be
impl Default for AtomicI32_le
impl Default for AtomicI64_be
impl Default for AtomicI64_le
impl Default for AtomicU16_be
impl Default for AtomicU16_le
impl Default for AtomicU32_be
impl Default for AtomicU32_le
impl Default for AtomicU64_be
impl Default for AtomicU64_le
impl Default for char_be
impl Default for char_le
impl Default for f32_be
impl Default for f32_le
impl Default for f64_be
impl Default for f64_le
impl Default for i16_be
impl Default for i16_le
impl Default for i32_be
impl Default for i32_le
impl Default for i64_be
impl Default for i64_le
impl Default for i128_be
impl Default for i128_le
impl Default for u16_be
impl Default for u16_le
impl Default for u32_be
impl Default for u32_le
impl Default for u64_be
impl Default for u64_le
impl Default for u128_be
impl Default for u128_le
impl Default for char_ube
impl Default for char_ule
impl Default for f32_ube
impl Default for f32_ule
impl Default for f64_ube
impl Default for f64_ule
impl Default for i16_ube
impl Default for i16_ule
impl Default for i32_ube
impl Default for i32_ule
impl Default for i64_ube
impl Default for i64_ule
impl Default for i128_ube
impl Default for i128_ule
impl Default for u16_ube
impl Default for u16_ule
impl Default for u32_ube
impl Default for u32_ule
impl Default for u64_ube
impl Default for u64_ule
impl Default for u128_ube
impl Default for u128_ule
impl Default for Arena
impl Default for ArchivedDuration
impl Default for I24
impl Default for I48
impl Default for U24
impl Default for U48
impl Default for FdSetElement
impl Default for ReadFlags
impl Default for WatchFlags
impl Default for ResolveFlags
impl Default for EventFlags
impl Default for IoringAcceptFlags
impl Default for IoringAsyncCancelFlags
impl Default for IoringCqFlags
impl Default for IoringCqeFlags
impl Default for IoringEnterFlags
impl Default for IoringFeatureFlags
impl Default for IoringFsyncFlags
impl Default for IoringMsgringFlags
impl Default for IoringOpFlags
impl Default for IoringPollFlags
impl Default for IoringRecvFlags
impl Default for IoringRegisterFlags
impl Default for IoringRsrcFlags
impl Default for IoringSendFlags
impl Default for IoringSetupFlags
impl Default for IoringSqFlags
impl Default for IoringSqeFlags
impl Default for IoringTimeoutFlags
impl Default for RecvmsgOutFlags
impl Default for SpliceFlags
impl Default for addr3_struct
impl Default for buf_ring_bufs_struct
impl Default for buf_ring_tail_struct
impl Default for io_cqring_offsets
impl Default for io_sqring_offsets
impl Default for io_uring_buf
impl Default for io_uring_buf_reg
impl Default for io_uring_buf_ring
impl Default for io_uring_cqe
impl Default for io_uring_files_update
impl Default for io_uring_getevents_arg
impl Default for io_uring_params
impl Default for io_uring_probe
impl Default for io_uring_probe_op
impl Default for io_uring_ptr
impl Default for io_uring_recvmsg_out
impl Default for io_uring_restriction
impl Default for io_uring_rsrc_register
impl Default for io_uring_rsrc_update2
impl Default for io_uring_rsrc_update
impl Default for io_uring_sqe
impl Default for io_uring_sync_cancel_reg
impl Default for open_how
impl Default for tail_or_bufs_struct
impl Default for SendAncillaryBuffer<'_, '_, '_>
impl Default for CpuSet
impl Default for IgnoredAny
impl Default for Channels
impl Default for Md5
impl Default for CodecParameters
impl Default for CodecRegistry
impl Default for DecoderOptions
impl Default for FinalizeResult
impl Default for RandomNoise
impl Default for Complex
impl Default for FormatOptions
impl Default for SeekIndex
impl Default for MediaSourceStreamOptions
impl Default for Entry8x8
impl Default for Entry8x16
impl Default for Entry8x32
impl Default for Entry16x8
impl Default for Entry16x16
impl Default for Entry16x32
impl Default for Entry32x8
impl Default for Entry32x16
impl Default for Entry32x32
impl Default for devela::_dep::symphonia::core::meta::MetadataBuilder
impl Default for MetadataLog
impl Default for MetadataOptions
impl Default for MetadataRevision
impl Default for Size
impl Default for Hint
impl Default for Probe
impl Default for i24
impl Default for u24
impl Default for devela::_dep::symphonia::core::units::Time
impl Default for TimeBase
impl Default for CGroupLimits
impl Default for Components
impl Default for CpuRefreshKind
impl Default for DiskRefreshKind
impl Default for DiskUsage
impl Default for Disks
impl Default for Groups
impl Default for LoadAvg
impl Default for MemoryRefreshKind
impl Default for Networks
impl Default for ProcessRefreshKind
impl Default for RefreshKind
impl Default for devela::_dep::sysinfo::System
impl Default for Users
impl Default for Dispatch
impl Default for NoSubscriber
impl Default for JsValue
impl Default for f32x4
impl Default for f32x8
impl Default for f64x2
impl Default for f64x4
impl Default for i8x16
impl Default for i8x32
impl Default for i16x8
impl Default for i16x16
impl Default for i32x4
impl Default for i32x8
impl Default for i64x2
impl Default for i64x4
impl Default for u8x16
impl Default for u16x8
impl Default for u16x16
impl Default for u32x4
impl Default for u32x8
impl Default for u64x2
impl Default for u64x4
impl Default for ExampleBitfield
_bit_u8
and doc
only.impl Default for ExampleBitfieldCustom
_bit_u8
and doc
only.impl Default for ExampleBitfieldExtra
_bit_u8
and doc
only.impl Default for ExampleEnumSet
doc
only.impl Default for devela::all::Box<str>
impl Default for devela::all::Box<CStr>
impl Default for devela::all::Box<OsStr>
impl Default for devela::all::Box<dyn Modulator>
impl Default for Boxed
alloc
only.impl Default for FailedErrorConversion
impl Default for Error
impl Default for HasherFnv<u32>
impl Default for HasherFnv<u64>
impl Default for HasherFnv<u128>
impl Default for HasherFnv<usize>
impl Default for HasherFx<u32>
impl Default for HasherFx<u64>
impl Default for HasherFx<usize>
impl Default for HasherPengy
impl Default for Sink
impl Default for Lgc16
rand
only.impl Default for LinuxSigset
linux
only.impl Default for LinuxTerminal
unsafe_syscall
and linux
only.impl Default for LinuxTerminalSize
linux
only.impl Default for LinuxTermios
linux
only.impl Default for LinuxTimespec
linux
only.impl Default for NotImplemented
impl Default for NotSupported
impl Default for PathBuf
impl Default for PhantomPinned
impl Default for devela::all::RandomState
impl Default for RangeFull
impl Default for Rc<str>
impl Default for Rc<CStr>
impl Default for String
impl Default for Xabc
rand
only.impl Default for XorShift8
rand
only.impl Default for XorShift16
rand
only.impl Default for XorShift32
rand
only.impl Default for XorShift64
rand
only.impl Default for XorShift128
rand
only.impl Default for XorShift128p
rand
only.impl Default for Xoroshiro128pp
rand
only.impl Default for Xyza8a
rand
only.impl Default for Xyza8b
rand
only.impl Default for m128
impl Default for m128d
impl Default for m128i
impl Default for m256
impl Default for m256d
impl Default for m256i
impl Default for DataOverflow
impl Default for ElementNotFound
impl Default for IdPinBox
impl Default for IndexOutOfBounds
impl Default for InvalidAxisLength
impl Default for KeyAlreadyExists
impl Default for MismatchedCapacity
impl Default for MismatchedDimensions
impl Default for MismatchedIndices
impl Default for NodeEmpty
impl Default for NodeLinkNotSet
impl Default for NodeLinkNotUnique
impl Default for NotEnoughElements
impl Default for NotEnoughSpace
impl Default for PartiallyAdded
impl Default for CString
impl Default for OsString
impl Default for Duration
impl Default for SystemTimeError
impl Default for UnixTimeI64
impl Default for UnixTimeU32
impl Default for GraphemeString
impl Default for InvalidChar
impl Default for InvalidUtf8
impl Default for char7
impl Default for char8
impl Default for char16
impl Default for Arc<str>
impl Default for Arc<CStr>
impl Default for devela::work::AtomicBool
impl Default for AtomicF32
impl Default for AtomicF64
impl Default for devela::work::AtomicI8
impl Default for devela::work::AtomicI16
impl Default for devela::work::AtomicI32
impl Default for devela::work::AtomicI64
impl Default for AtomicI128
impl Default for devela::work::AtomicIsize
impl Default for devela::work::AtomicU8
impl Default for devela::work::AtomicU16
impl Default for devela::work::AtomicU32
impl Default for devela::work::AtomicU64
impl Default for AtomicU128
impl Default for devela::work::AtomicUsize
impl Default for devela::work::Condvar
impl Default for FormattingOptions
impl Default for SipHasher
impl Default for Alignment
Returns Alignment::MIN
, which is valid for any type.
impl Default for devela::_core::sync::atomic::AtomicBool
impl Default for devela::_core::sync::atomic::AtomicI8
impl Default for devela::_core::sync::atomic::AtomicI16
impl Default for devela::_core::sync::atomic::AtomicI32
impl Default for devela::_core::sync::atomic::AtomicI64
impl Default for devela::_core::sync::atomic::AtomicIsize
impl Default for devela::_core::sync::atomic::AtomicU8
impl Default for devela::_core::sync::atomic::AtomicU16
impl Default for devela::_core::sync::atomic::AtomicU32
impl Default for devela::_core::sync::atomic::AtomicU64
impl Default for devela::_core::sync::atomic::AtomicUsize
impl Default for BVec2
impl Default for BVec3
impl Default for BVec4
impl Default for BVec3A
impl Default for BVec4A
impl Default for Affine2
impl Default for Affine3A
impl Default for Mat3
impl Default for Mat2
impl Default for Mat3A
impl Default for Mat4
impl Default for Quat
impl Default for Vec3A
impl Default for Vec4
impl Default for Vec2
impl Default for Vec3
impl Default for DAffine2
impl Default for DAffine3
impl Default for DMat2
impl Default for DMat3
impl Default for DMat4
impl Default for DQuat
impl Default for DVec2
impl Default for DVec3
impl Default for DVec4
impl Default for I8Vec2
impl Default for I8Vec3
impl Default for I8Vec4
impl Default for I16Vec2
impl Default for I16Vec3
impl Default for I16Vec4
impl Default for IVec2
impl Default for IVec3
impl Default for IVec4
impl Default for I64Vec2
impl Default for I64Vec3
impl Default for I64Vec4
impl Default for U8Vec2
impl Default for U8Vec3
impl Default for U8Vec4
impl Default for U16Vec2
impl Default for U16Vec3
impl Default for U16Vec4
impl Default for UVec2
impl Default for UVec3
impl Default for UVec4
impl Default for U64Vec2
impl Default for U64Vec3
impl Default for U64Vec4
impl Default for Buffer
impl Default for devela::_info::examples::niche::NonExtremeI8
doc
only.impl Default for devela::all::NonExtremeI8
impl Default for NonExtremeU8
impl Default for NonExtremeU16
impl Default for epoll_data_t
impl Default for in6_un_t
impl Default for io_uring_sqe_buf_addr_t
impl Default for io_uring_sqe_buf_group_t
impl Default for io_uring_sqe_file_off_t
impl Default for io_uring_sqe_opt_buf_t
impl Default for io_uring_sqe_other_flags_t
impl Default for semun_t
impl Default for sifields_t
impl Default for sigev_un_t
impl Default for siginfo_t
impl Default for sigval_t
impl Default for addr3_or_cmd_union
impl Default for addr_or_splice_off_in_union
impl Default for buf_union
impl Default for io_uring_user_data
impl Default for ioprio_union
impl Default for len_union
impl Default for off_or_addr2_union
impl Default for op_flags_union
impl Default for register_or_sqe_op_or_sqe_flags_union
impl Default for splice_fd_in_or_file_index_union
impl Default for Addr
impl Default for Backoff
impl Default for Bytes
impl Default for BytesMut
impl Default for Collector
impl Default for Condvar
impl Default for Configuration
impl Default for Connect
impl Default for EvCtrl
impl Default for EvNote
impl Default for EvResult
impl Default for FixedState
impl Default for FixedState
impl Default for I11
impl Default for I20
impl Default for Once
impl Default for OnceBool
impl Default for OnceNonZeroUsize
impl Default for Parker
impl Default for RandomState
impl Default for RandomState
impl Default for SignalOnly
impl Default for SpinWait
impl Default for U11
impl Default for U20
impl Default for UnparkResult
impl Default for WaitGroup
impl Default for WithRawSiginfo
impl<'a> Default for &'a BStr
impl<'a> Default for &'a devela::_dep::winnow::Bytes
impl<'a> Default for devela::_dep::bumpalo::boxed::Box<'a, str>
impl<'a> Default for devela::_dep::log::MetadataBuilder<'a>
impl<'a> Default for RecordBuilder<'a>
impl<'a, 'b, T> Default for ExampleEnum<'a, 'b, T>where
T: Clone,
doc
only.impl<'a, K, V> Default for devela::_dep::_alloc::collections::btree_map::Iter<'a, K, V>where
K: 'a,
V: 'a,
impl<'a, K, V> Default for devela::_dep::_alloc::collections::btree_map::IterMut<'a, K, V>where
K: 'a,
V: 'a,
impl<'a, T> Default for devela::_dep::bumpalo::boxed::Box<'a, [T]>
impl<'a, T> Default for OnceRef<'a, T>
impl<'a, T: Default + 'a> Default for ConstList<'a, T>
impl<'buf> Default for RecvAncillaryBuffer<'buf>
impl<A> Default for VecChunk<A>
alloc
only.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 AudioManagerSettings<B>
impl<C> Default for ContextError<C>
impl<DST: ?Sized, BUF: DstBuf + Default> Default for DstQueue<DST, BUF>
unsafe_layout
only.impl<DST: ?Sized, BUF: DstBuf + Default> Default for DstStack<DST, BUF>
unsafe_layout
only.impl<E> Default for Codebook<E>where
E: Default + CodebookEntry,
impl<F, T> Default for Identity<F, T>
impl<F, T> Default for Rectangular<F, T>
impl<F, T> Default for Triangular<F, T>
impl<H> Default for BuildHasherDefault<H>
impl<I> Default for LocatingSlice<I>where
I: Default,
impl<I> Default for Partial<I>where
I: Default + StreamIsPartial,
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, S> Default for Stateful<I, S>
impl<Idx> Default for devela::all::Range<Idx>where
Idx: Default,
impl<Idx> Default for devela::_core::range::Range<Idx>where
Idx: Default,
impl<K> Default for devela::_dep::_std::collections::hash_set::IntoIter<K>
impl<K> Default for devela::_dep::_std::collections::hash_set::Iter<'_, K>
impl<K> Default for devela::_dep::hashbrown::hash_set::Iter<'_, K>
impl<K, A> Default for devela::_dep::hashbrown::hash_set::IntoIter<K, A>where
A: Allocator,
impl<K, V> Default for devela::_dep::_alloc::collections::btree_map::Keys<'_, K, V>
impl<K, V> Default for devela::_dep::_alloc::collections::btree_map::Range<'_, K, V>
impl<K, V> Default for RangeMut<'_, K, V>
impl<K, V> Default for devela::_dep::_alloc::collections::btree_map::Values<'_, K, V>
impl<K, V> Default for devela::_dep::_alloc::collections::btree_map::ValuesMut<'_, K, V>
impl<K, V> Default for devela::_dep::_std::collections::hash_map::IntoIter<K, V>
impl<K, V> Default for devela::_dep::_std::collections::hash_map::IntoKeys<K, V>
impl<K, V> Default for devela::_dep::_std::collections::hash_map::IntoValues<K, V>
impl<K, V> Default for devela::_dep::_std::collections::hash_map::Iter<'_, K, V>
impl<K, V> Default for devela::_dep::_std::collections::hash_map::IterMut<'_, K, V>
impl<K, V> Default for devela::_dep::_std::collections::hash_map::Keys<'_, K, V>
impl<K, V> Default for devela::_dep::_std::collections::hash_map::Values<'_, K, V>
impl<K, V> Default for devela::_dep::_std::collections::hash_map::ValuesMut<'_, K, V>
impl<K, V> Default for devela::_dep::hashbrown::hash_map::Iter<'_, K, V>
impl<K, V> Default for devela::_dep::hashbrown::hash_map::IterMut<'_, K, V>
impl<K, V> Default for devela::_dep::hashbrown::hash_map::Keys<'_, K, V>
impl<K, V> Default for devela::_dep::hashbrown::hash_map::Values<'_, K, V>
impl<K, V> Default for devela::_dep::hashbrown::hash_map::ValuesMut<'_, K, V>
impl<K, V> Default for BTreeMap<K, V>
impl<K, V, A> Default for devela::_dep::_alloc::collections::btree_map::IntoIter<K, V, A>
impl<K, V, A> Default for devela::_dep::_alloc::collections::btree_map::IntoKeys<K, V, A>
impl<K, V, A> Default for devela::_dep::_alloc::collections::btree_map::IntoValues<K, V, A>
impl<K, V, A> Default for devela::_dep::hashbrown::hash_map::IntoIter<K, V, A>where
A: Allocator,
impl<K, V, A> Default for devela::_dep::hashbrown::hash_map::IntoKeys<K, V, A>where
A: Allocator,
impl<K, V, A> Default for devela::_dep::hashbrown::hash_map::IntoValues<K, V, A>where
A: Allocator,
impl<K, V, S> Default for devela::_dep::_std::collections::HashMap<K, V, S>where
S: Default,
impl<K, V, S, A> Default for devela::all::HashMap<K, V, S, A>
impl<N> Default for NicheInto<N>where
N: ?Sized,
impl<N: Default, H: Default> Default for Mismatch<N, H>
impl<R, G, T> Default for ReentrantMutex<R, G, T>
impl<R, T> Default for Mutex<R, T>
impl<R, T> Default for RwLock<R, T>
impl<S> Default for devela::_dep::rodio::source::Empty<S>
impl<S: Default, V: Default> Default for Own<S, V>
impl<Storage> Default for __BindgenBitfieldUnit<Storage>where
Storage: Default,
impl<Storage> Default for __BindgenBitfieldUnit<Storage>where
Storage: Default,
impl<Storage, Align> Default for __BindgenBitfieldUnit<Storage, Align>
impl<T0> Default for ArchivedTuple1<T0>where
T0: Default,
impl<T0, T1> Default for ArchivedTuple2<T0, T1>
impl<T0, T1, T2> Default for ArchivedTuple3<T0, T1, T2>
impl<T0, T1, T2, T3> Default for ArchivedTuple4<T0, T1, T2, T3>
impl<T0, T1, T2, T3, T4> Default for ArchivedTuple5<T0, T1, T2, T3, T4>
impl<T0, T1, T2, T3, T4, T5> Default for ArchivedTuple6<T0, T1, T2, T3, T4, T5>
impl<T0, T1, T2, T3, T4, T5, T6> Default for ArchivedTuple7<T0, T1, T2, T3, T4, T5, T6>
impl<T0, T1, T2, T3, T4, T5, T6, T7> Default for ArchivedTuple8<T0, T1, T2, T3, T4, T5, T6, T7>
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> Default for ArchivedTuple9<T0, T1, T2, T3, T4, T5, T6, T7, T8>
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> Default for ArchivedTuple10<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Default for ArchivedTuple11<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Default for ArchivedTuple12<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>
impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Default for ArchivedTuple13<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>
impl<T> Default for &[T]
impl<T> Default for &mut [T]
impl<T> Default for Value<T>where
T: Default,
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 (T₁, T₂, …, Tₙ)where
T: Default,
This trait is implemented for tuples up to twelve items long.
impl<T> Default for devela::_dep::_alloc::collections::binary_heap::IntoIter<T>
impl<T> Default for devela::_dep::_alloc::collections::binary_heap::Iter<'_, T>
impl<T> Default for devela::_dep::_alloc::collections::btree_set::Iter<'_, T>
impl<T> Default for devela::_dep::_alloc::collections::btree_set::Range<'_, T>
impl<T> Default for devela::_dep::_alloc::collections::linked_list::IntoIter<T>
impl<T> Default for devela::_dep::_alloc::collections::linked_list::Iter<'_, T>
impl<T> Default for devela::_dep::_alloc::collections::linked_list::IterMut<'_, T>
impl<T> Default for devela::_dep::_alloc::collections::vec_deque::Iter<'_, T>
impl<T> Default for devela::_dep::_alloc::collections::vec_deque::IterMut<'_, T>
impl<T> Default for LazyLock<T>where
T: Default,
impl<T> Default for ReentrantLock<T>where
T: Default,
impl<T> Default for devela::_dep::hashbrown::hash_table::Iter<'_, T>
impl<T> Default for IterHash<'_, T>
impl<T> Default for IterHashMut<'_, T>
impl<T> Default for devela::_dep::hashbrown::hash_table::IterMut<'_, T>
impl<T> Default for GILOnceCell<T>
impl<T> Default for ArchivedRange<T>where
T: Default,
impl<T> Default for ArchivedRangeFrom<T>where
T: Default,
impl<T> Default for ArchivedRangeInclusive<T>where
T: Default,
impl<T> Default for ArchivedRangeTo<T>where
T: Default,
impl<T> Default for ArchivedRangeToInclusive<T>where
T: Default,
impl<T> Default for BTreeSet<T>
impl<T> Default for BinaryHeap<T>where
T: Ord,
impl<T> Default for devela::all::Box<[T]>
impl<T> Default for devela::all::Box<T>where
T: Default,
impl<T> Default for Cell<T>where
T: Default,
impl<T> Default for Cursor<T>where
T: Default,
impl<T> Default for devela::all::IterEmpty<T>
impl<T> Default for LazyCell<T>where
T: Default,
impl<T> Default for LinkedList<T>
impl<T> Default for ManuallyDrop<T>
impl<T> Default for devela::all::OnceCell<T>
impl<T> Default for AssertUnwindSafe<T>where
T: Default,
impl<T> Default for PhantomData<T>where
T: ?Sized,
impl<T> Default for Rc<[T]>
impl<T> Default for Rc<T>where
T: Default,
impl<T> Default for devela::all::RcWeak<T>
impl<T> Default for RefCell<T>where
T: Default,
impl<T> Default for Saturating<T>where
T: Default,
impl<T> Default for TypeResource<T>
impl<T> Default for UnsafeCell<T>where
T: Default,
impl<T> Default for Vec<T>
impl<T> Default for VecDeque<T>
impl<T> Default for Wrapping<T>where
T: Default,
impl<T> Default for Interval<T>
Provides a default value for Interval
, the unbounded interval $(-\infty, \infty)$.
This choice emphasizes neutrality and generality,
where the interval encompasses all possible values of T
. It:
- Represents a neutral and maximal range for generic use cases.
- Avoids reliance on
Default
forT
, making it applicable to all types. - Aligns with mathematical conventions, where unbounded intervals are a natural default.
impl<T> Default for Reverse<T>where
T: Default,
impl<T> Default for Arc<[T]>
impl<T> Default for Arc<T>where
T: Default,
impl<T> Default for devela::work::ArcWeak<T>
impl<T> Default for devela::work::Atomic<T>where
T: Default,
impl<T> Default for devela::work::AtomicPtr<T>
impl<T> Default for devela::work::Mutex<T>
impl<T> Default for OnceLock<T>
impl<T> Default for devela::work::RwLock<T>where
T: Default,
impl<T> Default for SyncUnsafeCell<T>where
T: Default,
impl<T> Default for devela::_core::slice::Iter<'_, T>
impl<T> Default for devela::_core::slice::IterMut<'_, T>
impl<T> Default for devela::_core::sync::atomic::AtomicPtr<T>
impl<T> Default for Exclusive<T>
impl<T> Default for Atomic<T>where
T: Pointable + ?Sized,
impl<T> Default for AtomicCell<T>where
T: Default,
impl<T> Default for CachePadded<T>where
T: Default,
impl<T> Default for Channel<T>
impl<T> Default for EvQueueControl<T>where
T: Default,
impl<T> Default for Injector<T>
impl<T> Default for Lazy<T>where
T: Default,
impl<T> Default for Lazy<T>where
T: Default,
impl<T> Default for OnceBox<T>
impl<T> Default for OnceCell<T>
impl<T> Default for OnceCell<T>
impl<T> Default for ShardedLock<T>where
T: Default,
impl<T> Default for TripleBuffer<T>
impl<T> Default for __BindgenUnionField<T>
impl<T> Default for __BindgenUnionField<T>
impl<T> Default for __IncompleteArrayField<T>where
T: Default,
impl<T> Default for __IncompleteArrayField<T>where
T: Default,
impl<T> Default for __IncompleteArrayField<T>where
T: Default,
impl<T> Default for __IncompleteArrayField<T>where
T: Default,
impl<T> Default for __IncompleteArrayField<T>where
T: Default,
impl<T> Default for __IncompleteArrayField<T>where
T: Default,
impl<T, A> Default for devela::_dep::_alloc::collections::btree_set::IntoIter<T, A>
impl<T, A> Default for devela::_dep::_alloc::vec::IntoIter<T, A>
impl<T, A> Default for devela::_dep::hashbrown::hash_table::IntoIter<T, A>where
A: Allocator,
impl<T, A> Default for HashTable<T, A>
impl<T, S> Default for devela::_dep::_std::collections::HashSet<T, S>where
S: Default,
impl<T, S, A> Default for devela::all::HashSet<T, S, A>
impl<T, const CAP: usize> Default for ArrayVec<T, CAP>
impl<T, const N: usize> Default for InlineVec<T, N>
impl<T, const N: usize> Default for Mask<T, N>
impl<T, const N: usize> Default for Simd<T, N>
impl<T: MemPod, const CAP: usize> Default for DstArray<T, CAP>
unsafe_layout
only.impl<T: Default> Default for Angle<T>
geom
only.impl<T: Default> Default for BareBox<T>
impl<T: Default> Default for CacheAlign<T>
impl<T: Default> Default for VecVector<T>
alg
only.impl<T: Default> Default for Cast<T>
prim···
only.impl<T: Default, E: Default> Default for CoroRun<T, E>
unsafe_async
only.impl<T: Default, const C: usize, const R: usize, const CR: usize, const RMAJ: bool> Default for Array2d<T, C, R, CR, RMAJ, Boxed>
alloc
only.impl<T: Default, const C: usize, const R: usize, const CR: usize, const RMAJ: bool> Default for Array2d<T, C, R, CR, RMAJ, Bare>
impl<T: Default, const CAP: usize> Default for devela::all::Array<T, CAP, Boxed>
alloc
only.impl<T: Default, const CAP: usize> Default for devela::all::Array<T, CAP, Bare>
impl<T: Default, const CAP: usize, IDX: Default> Default for Destaque<T, CAP, IDX, Boxed>
impl<T: Default, const CAP: usize, IDX: Default> Default for Destaque<T, CAP, IDX, Bare>
impl<T: Default, const CAP: usize, IDX: Default> Default for Stack<T, CAP, IDX, Boxed>
alloc
only.impl<T: Default, const CAP: usize, IDX: Default> Default for Stack<T, CAP, IDX, Bare>
impl<T: Default, const CAP: usize, S: Default + Storage> Default for ArrayUninit<T, CAP, S>
unsafe_array
only.impl<T: Default, const D: usize> Default for Extent<T, D>
geom
only.impl<T: Default, const D: usize> Default for Point<T, D>
geom
only.impl<T: Default, const D: usize> Default for Vector<T, D>
alg
only.impl<V: Default, Q: Default> Default for ValueQuant<V, Q>
impl<W, A, S> Default for Serializer<W, A, S>
impl<W, N> Default for MapNiche<W, N>
impl<Y: Default, MO: Default, D: Default, H: Default, M: Default, S: Default, MS: Default, US: Default, NS: Default> Default for TimeSplit<Y, MO, D, H, M, S, MS, US, NS>
impl<const A: usize> Default for AlignedVec<A>
impl<const CAP: usize> Default for StringNonul<CAP>
_string_nonul
only.impl<const CAP: usize> Default for StringU8<CAP>
impl<const CAP: usize> Default for StringU16<CAP>
impl<const CAP: usize> Default for StringU32<CAP>
impl<const CAP: usize> Default for StringUsize<CAP>
impl<const CAP: usize> Default for GraphemeNonul<CAP>
impl<const CAP: usize> Default for GraphemeU8<CAP>
impl<const CAP: usize> Default for ArrayString<CAP>
impl<const SH1: usize, const SH2: usize, const SH3: usize> Default for XorShift8Custom<SH1, SH2, SH3>
rand
only.