pub trait Default: Sized {
    // Required method
    fn default() -> Self;
}
Available on non-crate feature miri-test-libstd only.
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 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 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.

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§

source

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 }
}

Implementors§

const: unstable · source§

impl Default for &str

1.10.0 · source§

impl Default for &CStr

1.9.0 · source§

impl Default for &OsStr

1.28.0 · source§

impl Default for &mut str

source§

impl Default for PreferredCompression

const: unstable · source§

impl Default for bool

const: unstable · source§

impl Default for char

const: unstable · source§

impl Default for f32

const: unstable · source§

impl Default for f64

const: unstable · source§

impl Default for i8

const: unstable · source§

impl Default for i16

const: unstable · source§

impl Default for i32

const: unstable · source§

impl Default for i64

const: unstable · source§

impl Default for i128

const: unstable · source§

impl Default for isize

const: unstable · source§

impl Default for u8

const: unstable · source§

impl Default for u16

const: unstable · source§

impl Default for u32

const: unstable · source§

impl Default for u64

const: unstable · source§

impl Default for u128

const: unstable · source§

impl Default for ()

const: unstable · source§

impl Default for usize

source§

impl Default for CompressionOptions

source§

impl Default for AllowList

The default cache_for is 1 hour.

source§

impl Default for Rule

Gives content-security-policy: default-src 'self'; style-src 'self' 'unsafe-inline'.

source§

impl Default for ValueSet

source§

impl Default for Plugins

Available on crate feature handover only.
source§

impl Default for kvarn::extensions::Extensions

source§

impl Default for Options

source§

impl Default for LimitManager

Default is Self::new(10, 10, 10).

source§

impl Default for RunConfig

source§

impl Default for Settings

§

impl Default for Bytes

§

impl Default for BytesMut

source§

impl Default for SipHasher

1.33.0 · source§

impl Default for PhantomPinned

source§

impl Default for RangeFull

const: unstable · source§

impl Default for AtomicBool

Available on target_has_atomic_load_store="8" only.
1.34.0 (const: unstable) · source§

impl Default for AtomicI8

1.34.0 (const: unstable) · source§

impl Default for AtomicI16

1.34.0 (const: unstable) · source§

impl Default for AtomicI32

1.34.0 (const: unstable) · source§

impl Default for AtomicI64

const: unstable · source§

impl Default for AtomicIsize

1.34.0 (const: unstable) · source§

impl Default for AtomicU8

1.34.0 (const: unstable) · source§

impl Default for AtomicU16

1.34.0 (const: unstable) · source§

impl Default for AtomicU32

1.34.0 (const: unstable) · source§

impl Default for AtomicU64

const: unstable · source§

impl Default for AtomicUsize

1.3.0 · source§

impl Default for kvarn::prelude::compact_str::core::time::Duration

§

impl Default for CompactString

source§

impl Default for Error

§

impl Default for kvarn::prelude::fs::OpenOptions

source§

impl Default for kvarn::prelude::io::Empty

source§

impl Default for Sink

source§

impl Default for Method

1.17.0 · source§

impl Default for PathBuf

source§

impl Default for StatusCode

source§

impl Default for kvarn::prelude::Version

source§

impl Default for WriteableBytes

source§

impl Default for kvarn::prelude::uri::Builder

source§

impl Default for Parts

source§

impl Default for Uri

Returns a Uri representing /

source§

impl Default for Global

1.17.0 (const: unstable) · source§

impl Default for Box<str, Global>

Available on non-no_global_oom_handling only.
1.17.0 · source§

impl Default for Box<CStr, Global>

1.17.0 · source§

impl Default for Box<OsStr, Global>

1.10.0 · source§

impl Default for CString

const: unstable · source§

impl Default for String

1.28.0 · source§

impl Default for System

1.13.0 (const: unstable) · source§

impl Default for DefaultHasher

1.7.0 · source§

impl Default for RandomState

1.9.0 · source§

impl Default for OsString

source§

impl Default for FileTimes

1.10.0 · source§

impl Default for std::sync::condvar::Condvar

source§

impl Default for Adler32

source§

impl Default for FixedBitSet

source§

impl Default for Crc

source§

impl Default for GzBuilder

source§

impl Default for GzHeader

source§

impl Default for Compression

source§

impl Default for h2::client::Builder

source§

impl Default for h2::server::Builder

source§

impl Default for http::extensions::Extensions

source§

impl Default for http::request::Builder

source§

impl Default for http::response::Builder

source§

impl Default for itoa::Buffer

source§

impl Default for BigInt

source§

impl Default for BigUint

source§

impl Default for Time

source§

impl Default for ryu::buffer::Buffer

source§

impl Default for B0

source§

impl Default for B1

source§

impl Default for Z0

source§

impl Default for Equal

source§

impl Default for Greater

source§

impl Default for Less

source§

impl Default for UTerm

source§

impl Default for Braced

source§

impl Default for Hyphenated

source§

impl Default for Simple

source§

impl Default for Urn

source§

impl Default for Uuid

source§

impl Default for NoContext

source§

impl Default for ThreadRng

source§

impl Default for OsRng

source§

impl Default for Csp

source§

impl Default for Vary

§

impl Default for Acceptor

§

impl Default for AnyDelimiterCodec

§

impl Default for Array264i

§

impl Default for Array528i

§

impl Default for Array712i

§

impl Default for AtomicWaker

§

impl Default for Backoff

§

impl Default for BbrConfig

§

impl Default for BigEndian

§

impl Default for BlockSwitch

§

impl Default for BroCatli

§

impl Default for BroccoliState

§

impl Default for BrotliEncoderParams

§

impl Default for Builder

§

impl Default for BytesCodec

§

impl Default for CancellationToken

§

impl Default for Collector

§

impl Default for Command

§

impl Default for CompressorOxide

§

impl Default for Condvar

§

impl Default for Config

§

impl Default for ConnectionStats

§

impl Default for ContextType

§

impl Default for CubicConfig

§

impl Default for Day

Creates a modifier that indicates the value is padded with zeroes.

§

impl Default for DecompressorOxide

§

impl Default for DirBuilder

§

impl Default for DirBuilder

§

impl Default for Dispatch

§

impl Default for Duration

§

impl Default for Eager

§

impl Default for EmptyIVec

§

impl Default for EndpointConfig

Available on crate feature ring only.
§

impl Default for Event

§

impl Default for EventAttributes

§

impl Default for EventKind

§

impl Default for FinderBuilder

§

impl Default for FnvHasher

§

impl Default for FrameHeader

§

impl Default for FrameStats

§

impl Default for FxHasher

§

impl Default for GeneralPurposeConfig

§

impl Default for H9Opts

§

impl Default for Hasher

§

impl Default for HistogramCommand

§

impl Default for HistogramDistance

§

impl Default for HistogramLiteral

§

impl Default for HistogramPair

§

impl Default for Hour

Creates a modifier that indicates the value is padded with zeroes and has the 24-hour representation.

§

impl Default for HuffmanCode

§

impl Default for HuffmanTree

§

impl Default for IdleTimeout

§

impl Default for InflateState

§

impl Default for InvalidBufferSize

§

impl Default for InvalidOutputSize

§

impl Default for Lazy

§

impl Default for LengthDelimitedCodec

§

impl Default for LinesCodec

§

impl Default for LiteralBlockSwitch

§

impl Default for LiteralPredictionModeNibble

§

impl Default for LittleEndian

§

impl Default for LocalPool

§

impl Default for LocalSet

§

impl Default for MessageDeframer

§

impl Default for MessageFragmenter

§

impl Default for Minute

Creates a modifier that indicates the value is padded with zeroes.

§

impl Default for MissedTickBehavior

§

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 MtuDiscoveryConfig

§

impl Default for MultiThreadedSpawner

§

impl Default for NewRenoConfig

§

impl Default for NoSubscriber

§

impl Default for Notify

§

impl Default for Null

§

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 Once

§

impl Default for OnceBool

§

impl Default for OnceNonZeroUsize

§

impl Default for OpenHow

§

impl Default for OpenOptions

§

impl Default for OpenOptions

§

impl Default for Ordinal

Creates a modifier that indicates the value is padded with zeroes.

§

impl Default for PDF

§

impl Default for Padding

Creates a modifier that indicates the value is padded with zeroes.

§

impl Default for Parker

§

impl Default for PathStats

§

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 Prefilter

§

impl Default for Probe

§

impl Default for RandomConnectionIdGenerator

§

impl Default for ReasonCode

§

impl Default for RecvMeta

§

impl Default for Resumption

§

impl Default for Rng

§

impl Default for Second

Creates a modifier that indicates the value is padded with zeroes.

§

impl Default for ServerConnectionData

§

impl Default for Sha1Core

§

impl Default for SingleThreadedSpawner

§

impl Default for SliceOffset

§

impl Default for Specification

Available on crate feature alloc only.
§

impl Default for SpinWait

§

impl Default for StandardAlloc

§

impl Default for StartPosQueue

§

impl Default for StatxBuilder

§

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 Timespec

§

impl Default for TransportConfig

§

impl Default for TransportParameters

§

impl Default for UdpSocketState

§

impl Default for UdpState

§

impl Default for UdpStats

§

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 UnparkResult

§

impl Default for VarInt

§

impl Default for Version

§

impl Default for WaitGroup

§

impl Default for WebSocketConfig

§

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 Written

§

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 YearRepr

Creates a modifier that indicates the value uses the Full representation.

§

impl Default for ZopfliNode

§

impl Default for vec128_storage

§

impl Default for vec256_storage

§

impl Default for vec512_storage

source§

impl<'a> Default for MetadataBuilder<'a>

source§

impl<'a> Default for RecordBuilder<'a>

§

impl<'a> Default for InputReference<'a>

§

impl<'a> Default for InputReferenceMut<'a>

§

impl<'a> Default for OidRegistry<'a>

§

impl<'a> Default for Select<'a>

§

impl<'a, T> Default for AllocatedStackMemory<'a, T>where T: 'a,

§

impl<'a, T> Default for HeapPrealloc<'a, T>where T: 'a,

§

impl<'a, T> Default for OnceRef<'a, T>

§

impl<'prev, 'now> Default for SubmitArgs<'prev, 'now>where 'prev: 'now,

§

impl<'s, T> Default for SliceVec<'s, T>

§

impl<A> Default for ArrayVec<A>where A: Array,

§

impl<A> Default for SmallVec<A>where A: Array,

§

impl<A> Default for TinyVec<A>where A: Array,

§

impl<Alloc> Default for UnionHasher<Alloc>where Alloc: Allocator<u16> + Allocator<u32>,

§

impl<AllocU8, AllocU16, AllocI32, AllocU32, AllocU64, AllocCommand, AllocFloatX, AllocV8, AllocS16, AllocPDF, AllocStaticCommand, AllocHistogramLiteral, AllocHistogramCommand, AllocHistogramDistance, AllocHistogramPair, AllocContextType, AllocHuffmanTree, AllocZopfliNode> Default for CombiningAllocator<AllocU8, AllocU16, AllocI32, AllocU32, AllocU64, AllocCommand, AllocFloatX, AllocV8, AllocS16, AllocPDF, AllocStaticCommand, AllocHistogramLiteral, AllocHistogramCommand, AllocHistogramDistance, AllocHistogramPair, AllocContextType, AllocHuffmanTree, AllocZopfliNode>where AllocU8: Allocator<u8> + Default, AllocU16: Allocator<u16> + Default, AllocI32: Allocator<i32> + Default, AllocU32: Allocator<u32> + Default, AllocU64: Allocator<u64> + Default, AllocCommand: Allocator<Command> + Default, AllocFloatX: Allocator<f32> + Default, AllocV8: Allocator<CompatF8> + Default, AllocS16: Allocator<Compat16x16> + Default, AllocPDF: Allocator<PDF> + Default, AllocStaticCommand: Allocator<Command<SliceOffset>> + Default, AllocHistogramLiteral: Allocator<HistogramLiteral> + Default, AllocHistogramCommand: Allocator<HistogramCommand> + Default, AllocHistogramDistance: Allocator<HistogramDistance> + Default, AllocHistogramPair: Allocator<HistogramPair> + Default, AllocContextType: Allocator<ContextType> + Default, AllocHuffmanTree: Allocator<HuffmanTree> + Default, AllocZopfliNode: Allocator<ZopfliNode> + Default,

§

impl<AllocU32, AllocHC> Default for HuffmanTreeGroup<AllocU32, AllocHC>where AllocU32: Allocator<u32>, AllocHC: Allocator<HuffmanCode>,

1.11.0 · source§

impl<B> Default for Cow<'_, B>where B: ToOwned + ?Sized, <B as ToOwned>::Owned: Default,

source§

impl<B> Default for Control<B>

The default is Continue.

§

impl<BlockSize, Kind> Default for BlockBuffer<BlockSize, Kind>where BlockSize: ArrayLength<u8> + IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>, <BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero, Kind: BufferKind,

source§

impl<E, Ix> Default for List<E, Ix>where E: Default, Ix: Default + IndexType,

§

impl<F> Default for OptionFuture<F>

§

impl<Fut> Default for FuturesOrdered<Fut>where Fut: Future,

§

impl<Fut> Default for FuturesUnordered<Fut>

1.7.0 (const: unstable) · source§

impl<H> Default for BuildHasherDefault<H>

source§

impl<Idx> Default for Range<Idx>where Idx: Default,

source§

impl<Ix> Default for EdgeIndex<Ix>where Ix: Default,

source§

impl<Ix> Default for NodeIndex<Ix>where Ix: Default,

§

impl<K, S> Default for DashSet<K, S>where K: Eq + Hash, S: Default + BuildHasher + Clone,

source§

impl<K, V> Default for BTreeMap<K, V, Global>

§

impl<K, V> Default for CacheBuilder<K, V, Cache<K, V, RandomState>>where K: Eq + Hash + Send + Sync + 'static, V: Clone + Send + Sync + 'static,

source§

impl<K, V, S> Default for kvarn::prelude::HashMap<K, V, S>where S: Default,

source§

impl<K, V, S> Default for IndexMap<K, V, S>where S: Default,

§

impl<K, V, S> Default for DashMap<K, V, S>where K: Eq + Hash, S: Default + BuildHasher + Clone,

§

impl<K, V, S, A> Default for HashMap<K, V, S, A>where S: Default, A: Default + Allocator + Clone,

§

impl<K, V, S, A> Default for HashMap<K, V, S, A>where S: Default, A: Default + Allocator + Clone,

source§

impl<K: Hash + Eq + Send + Sync + 'static, V: Clone + Send + Sync + 'static> Default for MokaCache<K, V>

source§

impl<N> Default for TarjanScc<N>

source§

impl<N, E, Ty> Default for GraphMap<N, E, Ty>where N: NodeTrait, Ty: EdgeType,

Create a new empty GraphMap.

source§

impl<N, E, Ty, Ix> Default for Csr<N, E, Ty, Ix>where Ty: EdgeType, Ix: IndexType,

source§

impl<N, E, Ty, Ix> Default for StableGraph<N, E, Ty, Ix>where Ty: EdgeType, Ix: IndexType,

Create a new empty StableGraph.

source§

impl<N, E, Ty, Ix> Default for Graph<N, E, Ty, Ix>where Ty: EdgeType, Ix: IndexType,

Create a new empty Graph.

source§

impl<N, E, Ty, Null, Ix> Default for MatrixGraph<N, E, Ty, Null, Ix>where Ty: EdgeType, Null: Nullable<Wrapped = E>, Ix: IndexType,

Create a new empty MatrixGraph.

source§

impl<N, VM> Default for DfsSpace<N, VM>where VM: VisitMap<N> + Default,

source§

impl<N, VM> Default for Bfs<N, VM>where VM: Default,

source§

impl<N, VM> Default for Dfs<N, VM>where VM: Default,

source§

impl<N, VM> Default for DfsPostOrder<N, VM>where VM: Default,

source§

impl<N, VM> Default for Topo<N, VM>where VM: Default,

§

impl<R, G, T> Default for ReentrantMutex<R, G, T>where R: RawMutex, G: GetThreadId, T: Default + ?Sized,

§

impl<R, T> Default for Mutex<R, T>where R: RawMutex, T: Default + ?Sized,

§

impl<R, T> Default for RwLock<R, T>where R: RawRwLock, T: Default + ?Sized,

source§

impl<S> Default for Ascii<S>where S: Default,

source§

impl<S> Default for UniCase<S>where S: AsRef<str> + Default,

§

impl<S, C> Default for Builder<S, C>where S: Default + EntryMarker, C: Default + EntryMarker,

§

impl<SliceType> Default for Command<SliceType>where SliceType: SliceWrapper<u8>,

§

impl<SliceType> Default for FeatureFlagSliceType<SliceType>where SliceType: SliceWrapper<u8> + Default,

Available on non-crate feature external-literal-probability only.
§

impl<St> Default for SelectAll<St>where St: Stream + Unpin,

const: unstable · source§

impl<T> Default for &[T]

1.5.0 (const: unstable) · source§

impl<T> Default for &mut [T]

const: unstable · source§

impl<T> Default for Option<T>

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 0]

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 1]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 2]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 3]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 4]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 5]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 6]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 7]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 8]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 9]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 10]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 11]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 12]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 13]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 14]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 15]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 16]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 17]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 18]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 19]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 20]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 21]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 22]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 23]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 24]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 25]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 26]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 27]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 28]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 29]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 30]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 31]where T: Default,

1.4.0 (const: unstable) · source§

impl<T> Default for [T; 32]where T: Default,

const: unstable · source§

impl<T> Default for (T₁, T₂, …, Tₙ)where T: Default,

This trait is implemented for tuples up to twelve items long.

source§

impl<T> Default for Cell<T>where T: Default,

source§

impl<T> Default for LazyCell<T, fn() -> T>where T: Default,

source§

impl<T> Default for kvarn::prelude::compact_str::core::cell::OnceCell<T>

source§

impl<T> Default for RefCell<T>where T: Default,

source§

impl<T> Default for SyncUnsafeCell<T>where T: Default,

1.10.0 · source§

impl<T> Default for UnsafeCell<T>where T: Default,

1.19.0 · source§

impl<T> Default for Reverse<T>where T: Default,

1.2.0 (const: unstable) · source§

impl<T> Default for kvarn::prelude::compact_str::core::iter::Empty<T>

const: unstable · source§

impl<T> Default for PhantomData<T>where T: ?Sized,

1.20.0 · source§

impl<T> Default for ManuallyDrop<T>where T: Default + ?Sized,

source§

impl<T> Default for Saturating<T>where T: Default,

source§

impl<T> Default for Wrapping<T>where T: Default,

1.62.0 · source§

impl<T> Default for AssertUnwindSafe<T>where T: Default,

const: unstable · source§

impl<T> Default for AtomicPtr<T>

Available on target_has_atomic_load_store="ptr" only.
source§

impl<T> Default for Exclusive<T>where T: Default + ?Sized,

source§

impl<T> Default for HeaderMap<T>

source§

impl<T> Default for kvarn::prelude::io::Cursor<T>where T: Default,

source§

impl<T> Default for kvarn::prelude::Arc<T>where T: Default,

Available on non-no_global_oom_handling only.
§

impl<T> Default for kvarn::prelude::Mutex<T>where T: Default,

source§

impl<T> Default for Request<T>where T: Default,

source§

impl<T> Default for Response<T>where T: Default,

§

impl<T> Default for kvarn::prelude::RwLock<T>where T: Default + ?Sized,

const: unstable · source§

impl<T> Default for Box<[T], Global>

Available on non-no_global_oom_handling only.
source§

impl<T> Default for Box<T, Global>where T: Default,

Available on non-no_global_oom_handling only.
source§

impl<T> Default for BinaryHeap<T>where T: Ord,

source§

impl<T> Default for BTreeSet<T, Global>

source§

impl<T> Default for LinkedList<T>

source§

impl<T> Default for VecDeque<T, Global>

source§

impl<T> Default for Rc<T>where T: Default,

Available on non-no_global_oom_handling only.
1.10.0 · source§

impl<T> Default for alloc::rc::Weak<T>

1.10.0 · source§

impl<T> Default for alloc::sync::Weak<T>

const: unstable · source§

impl<T> Default for Vec<T, Global>

source§

impl<T> Default for LazyLock<T, fn() -> T>where T: Default,

1.10.0 · source§

impl<T> Default for std::sync::mutex::Mutex<T>where T: Default + ?Sized,

const: unstable · source§

impl<T> Default for OnceLock<T>

1.10.0 · source§

impl<T> Default for std::sync::rwlock::RwLock<T>where T: Default,

source§

impl<T> Default for NotZero<T>where T: Zero,

§

impl<T> Default for Arc<T>where T: Default,

§

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 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 Cursor<T>where T: Default,

§

impl<T> Default for FixedQueue<T>

§

impl<T> Default for HeapAlloc<T>where T: Clone + Default,

§

impl<T> Default for JoinSet<T>

§

impl<T> Default for Lazy<T, fn() -> T>where T: Default,

§

impl<T> Default for Lazy<T, fn() -> T>where T: Default,

§

impl<T> Default for Mutex<T>where T: Default + ?Sized,

§

impl<T> Default for Mutex<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 OnceCell<T>

§

impl<T> Default for RwLock<T>where T: Default + ?Sized,

§

impl<T> Default for SendableMemoryBlock<T>where T: Default + Clone,

§

impl<T> Default for ShardedLock<T>where T: Default,

§

impl<T> Default for Shared<'_, T>where T: Pointable + ?Sized,

§

impl<T> Default for Slab<T>

§

impl<T> Default for WrapBox<T>

§

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, A> Default for RawTable<T, A>where A: Allocator + Clone + Default,

§

impl<T, N> Default for GenericArray<T, N>where T: Default, N: ArrayLength<T>,

§

impl<T, OutSize, O> Default for CtVariableCoreWrapper<T, OutSize, O>where T: VariableOutputCore, OutSize: ArrayLength<u8> + IsLessOrEqual<<T as OutputSizeUser>::OutputSize>, <OutSize as IsLessOrEqual<<T as OutputSizeUser>::OutputSize>>::Output: NonZero, <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,

source§

impl<T, S> Default for std::collections::hash::set::HashSet<T, S>where S: Default,

source§

impl<T, S> Default for IndexSet<T, S>where S: Default,

§

impl<T, S, A> Default for HashSet<T, S, A>where S: Default, A: Default + Allocator + Clone,

§

impl<T, S, A> Default for HashSet<T, S, A>where S: Default, A: Default + Allocator + Clone,

source§

impl<T, const LANES: usize> Default for Mask<T, LANES>where T: MaskElement, LaneCount<LANES>: SupportedLaneCount,

source§

impl<T, const LANES: usize> Default for Simd<T, LANES>where LaneCount<LANES>: SupportedLaneCount, T: SimdElement + Default,

§

impl<T, const N: usize> Default for AtomicTagPtr<T, N>

§

impl<T, const N: usize> Default for TagPtr<T, N>

§

impl<Ty> Default for MemoryBlock<Ty>where Ty: Default,

Available on crate feature std only.
source§

impl<U> Default for NInt<U>where U: Default + Unsigned + NonZero,

source§

impl<U> Default for PInt<U>where U: Default + Unsigned + NonZero,

source§

impl<U, B> Default for UInt<U, B>where U: Default, B: Default,

§

impl<const CHUNK_SIZE: usize> Default for ReadBuffer<CHUNK_SIZE>