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.
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§
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 }
}
Implementors§
impl Default for &str
impl Default for &CStr
impl Default for &OsStr
impl Default for &mut str
impl Default for Code
impl Default for Key
impl Default for AccordionStatus
impl Default for Alignment
impl Default for ButtonStatus
impl Default for DirectionMode
impl Default for DropdownItemStatus
impl Default for DropdownStatus
impl Default for EditableMode
impl Default for InputMode
impl Default for InputStatus
impl Default for OrderDirection
impl Default for Position
impl Default for ScrollThumbState
impl Default for freya::prelude::Size
impl Default for SliderStatus
impl Default for SwitchStatus
impl Default for IpNet
impl Default for Value
The default value is Value::Null
.
This is useful for handling omitted Value
fields when deserializing.
Examples
use serde_json::Value;
#[derive(Deserialize)]
struct Settings {
level: i32,
#[serde(default)]
extras: Value,
}
let data = r#" { "level": 42 } "#;
let s: Settings = serde_json::from_str(data)?;
assert_eq!(s.level, 42);
assert_eq!(s.extras, Value::Null);
impl Default for PathArguments
impl Default for bool
impl Default for char
impl Default for f32
impl Default for f64
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 freya_core::accessibility::accessibility_state::AccessibilityState
impl Default for ElementsState
impl Default for Layers
impl Default for Viewports
impl Default for PluginsManager
impl Default for FreyaDOM
impl Default for NodeReferenceLayout
impl Default for Modifiers
impl Default for PerformanceOverlayPlugin
impl Default for Global
impl Default for alloc::boxed::Box<str, Global>
impl Default for alloc::boxed::Box<CStr, Global>
impl Default for alloc::boxed::Box<OsStr, Global>
impl Default for CString
impl Default for String
impl Default for Error
impl Default for SipHasher
impl Default for PhantomPinned
impl Default for RangeFull
impl Default for AtomicBool
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 Duration
impl Default for proc_macro::TokenStream
impl Default for System
impl Default for DefaultHasher
impl Default for std::collections::hash::map::RandomState
impl Default for OsString
impl Default for FileTimes
impl Default for std::io::util::Empty
impl Default for Sink
impl Default for PathBuf
impl Default for ExitStatus
The default value is one which indicates successful completion.
impl Default for std::sync::condvar::Condvar
impl Default for DateTime<FixedOffset>
impl Default for DateTime<Local>
impl Default for DateTime<Utc>
impl Default for 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 one with epoch 0 that is, 1st of January 1970 at 00:00:00.
Example
use chrono::NaiveDateTime;
let default_date = NaiveDateTime::default();
assert_eq!(Some(default_date), NaiveDateTime::from_timestamp_opt(0, 0));
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 FixedBitSet
impl Default for Crc
impl Default for GzBuilder
impl Default for GzHeader
impl Default for flate2::Compression
impl Default for h2::client::Builder
impl Default for h2::server::Builder
impl Default for bf16
impl Default for f16
impl Default for SizeHint
impl Default for Extensions
impl Default for Method
impl Default for http::request::Builder
impl Default for http::response::Builder
impl Default for StatusCode
impl Default for http::uri::builder::Builder
impl Default for Parts
impl Default for Uri
Returns a Uri
representing /
impl Default for Version
impl Default for Ipv4Net
impl Default for Ipv6Net
impl Default for itoa::Buffer
impl Default for Sha1
impl Default for Sha224
impl Default for Sha256
impl Default for Sha384
impl Default for Sha512
impl Default for AuthorityKeyIdentifier
impl Default for BasicConstraints
impl Default for ExtendedKeyUsage
impl Default for KeyUsage
impl Default for SubjectAlternativeName
impl Default for SubjectKeyIdentifier
impl Default for Time
impl Default for proc_macro2::TokenStream
TokenStream::default()
returns an empty stream,
i.e. this is equivalent with TokenStream::new()
.
impl Default for ryu::buffer::Buffer
impl Default for BuildMetadata
impl Default for Prerelease
impl Default for VersionReq
The default VersionReq is the same as VersionReq::STAR
.
impl Default for IgnoredAny
impl Default for serde_json::map::Map<String, Value>
impl Default for DefaultKey
impl Default for KeyData
impl Default for BoundLifetimes
impl Default for Generics
impl Default for Abstract
impl Default for And
impl Default for AndAnd
impl Default for AndEq
impl Default for As
impl Default for Async
impl Default for At
impl Default for Auto
impl Default for Await
impl Default for Become
impl Default for syn::token::Box
impl Default for Brace
impl Default for Bracket
impl Default for Break
impl Default for Caret
impl Default for CaretEq
impl Default for Colon
impl Default for Comma
impl Default for Const
impl Default for Continue
impl Default for Crate
impl Default for Default
impl Default for Do
impl Default for Dollar
impl Default for Dot
impl Default for DotDot
impl Default for DotDotDot
impl Default for DotDotEq
impl Default for Dyn
impl Default for Else
impl Default for Enum
impl Default for Eq
impl Default for EqEq
impl Default for Extern
impl Default for FatArrow
impl Default for Final
impl Default for Fn
impl Default for For
impl Default for Ge
impl Default for Group
impl Default for Gt
impl Default for If
impl Default for Impl
impl Default for In
impl Default for LArrow
impl Default for Le
impl Default for Let
impl Default for Loop
impl Default for Lt
impl Default for Macro
impl Default for Match
impl Default for Minus
impl Default for MinusEq
impl Default for Mod
impl Default for Move
impl Default for Mut
impl Default for Ne
impl Default for Not
impl Default for Or
impl Default for OrEq
impl Default for OrOr
impl Default for syn::token::Override
impl Default for Paren
impl Default for PathSep
impl Default for Percent
impl Default for PercentEq
impl Default for Plus
impl Default for PlusEq
impl Default for Pound
impl Default for Priv
impl Default for Pub
impl Default for Question
impl Default for RArrow
impl Default for Ref
impl Default for Return
impl Default for SelfType
impl Default for SelfValue
impl Default for Semi
impl Default for Shl
impl Default for ShlEq
impl Default for Shr
impl Default for ShrEq
impl Default for Slash
impl Default for SlashEq
impl Default for Star
impl Default for StarEq
impl Default for Static
impl Default for Struct
impl Default for Super
impl Default for Tilde
impl Default for Trait
impl Default for Try
impl Default for Type
impl Default for Typeof
impl Default for Underscore
impl Default for Union
impl Default for Unsafe
impl Default for Unsized
impl Default for Use
impl Default for Virtual
impl Default for Where
impl Default for While
impl Default for Yield
impl Default for B0
impl Default for B1
impl Default for Z0
impl Default for Equal
impl Default for Greater
impl Default for Less
impl Default for UTerm
impl Default for Braced
impl Default for Hyphenated
impl Default for Simple
impl Default for Urn
impl Default for Uuid
impl Default for NoContext
impl Default for ThreadRng
impl Default for OsRng
impl Default for AccordionThemeWith
impl Default for ArrowIconThemeWith
impl Default for BodyThemeWith
impl Default for ButtonThemeWith
impl Default for CanvasThemeWith
impl Default for DropdownItemThemeWith
impl Default for DropdownThemeWith
impl Default for ExternalLinkThemeWith
impl Default for FontThemeWith
impl Default for Gaps
impl Default for GraphThemeWith
impl Default for InputThemeWith
impl Default for LoaderThemeWith
impl Default for NetworkImageThemeWith
impl Default for Node
impl Default for NodeAreas
impl Default for ProgressBarThemeWith
impl Default for Rope
impl Default for ScrollBarThemeWith
impl Default for ScrollViewThemeWith
impl Default for SliderThemeWith
impl Default for SwitchThemeWith
impl Default for TableThemeWith
impl Default for TextCursor
impl Default for Theme
impl Default for TooltipThemeWith
impl Default for UniformsBuilder
impl Default for AHasher
Provides a default Hasher with fixed keys. This is typically used in conjunction with BuildHasherDefault to create [AHasher]s in order to hash the keys of the map.
Generally it is preferable to use [RandomState] instead, so that different hashmaps will have different keys. However if fixed keys are desireable this may be used instead.
Example
use std::hash::BuildHasherDefault;
use ahash::{AHasher, RandomState};
use std::collections::HashMap;
let mut map: HashMap<i32, i32, BuildHasherDefault<AHasher>> = HashMap::default();
map.insert(12, 34);
impl Default for Acceptor
impl Default for AccessibilityState
impl Default for AdaptiveFilterType
impl Default for Adler32
impl Default for Affine
impl Default for AhoCorasickBuilder
impl Default for AnyDelimiterCodec
impl Default for ApiPrefence
impl Default for AtomicWaker
impl Default for AtomicWaker
impl Default for AttributeMask
impl Default for AttributeMaskBuilder<'_>
impl Default for Axis
impl Default for BString
impl Default for BackIn
impl Default for BackInOut
impl Default for BackOut
impl Default for Backoff
impl Default for BigEndian
impl Default for BlendMode
impl Default for Block
impl Default for Blocking
impl Default for Body
impl Default for Border
impl Default for BorderAlignment
impl Default for BorderStyle
impl Default for BounceIn
impl Default for BounceInOut
impl Default for BounceOut
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 Builder
impl Default for Builder
impl Default for Builder
impl Default for Bump
impl Default for ByteClasses
impl Default for Bytes
impl Default for BytesCodec
impl Default for BytesMut
impl Default for CacheProperties
impl Default for CallBody
impl Default for Camera3D
impl Default for CancellationToken
impl Default for Channels
impl Default for CircIn
impl Default for CircInOut
impl Default for CircOut
impl Default for ClassBytesRange
impl Default for ClassUnicodeRange
impl Default for Client
impl Default for Client<HttpConnector<GaiResolver>, Body>
impl Default for ClientBuilder
impl Default for ClientMessageData
impl Default for ClipMask
impl Default for Cmd
impl Default for Collector
impl Default for Color
impl Default for ColorSpace
impl Default for ColorTheme
impl Default for Compression
impl Default for CompressionType
impl Default for Compressor
impl Default for CompressorOxide
impl Default for Condvar
impl Default for Config
impl Default for Config
impl Default for Config
impl Default for Config
impl Default for Config
impl Default for Config
impl Default for Config
impl Default for Config
impl Default for Config
impl Default for Config
The defaults are that of https://url.spec.whatwg.org/#idna
impl Default for ConfigTemplate
impl Default for ConfigTemplateBuilder
impl Default for Configuration
impl Default for ConnectionCredentials
impl Default for ContextApi
impl Default for ContextAttributes
impl Default for ContextAttributesBuilder
impl Default for ContextOptions
impl Default for ControlFlow
impl Default for Coordinate
impl Default for CornerRadius
impl Default for CropRect
impl Default for CubicCoeff
impl Default for CubicIn
impl Default for CubicInOut
impl Default for CubicOut
impl Default for Cursor
impl Default for CursorIcon
impl Default for CursorSettings
impl Default for DecodeOptions
impl Default for Decompressor
impl Default for DecompressorOxide
impl Default for Decoration
impl Default for DedupedLabels
impl Default for Deflate
impl Default for DeflateLevel
impl Default for DeflateOptions
impl Default for Dependants
impl Default for DependencyKind
impl Default for DeviceEventFilter
impl Default for DirBuilder
impl Default for Dispatch
impl Default for DisplayBuilder
impl Default for DynamicImage
impl Default for DynamicNode<'_>
impl Default for Eager
impl Default for Edition
impl Default for ElasticIn
impl Default for ElasticInOut
impl Default for ElasticOut
impl Default for ElementId
impl Default for EncodedOrigin
impl Default for Encoding
impl Default for EncodingFormat
impl Default for EntityId
Allows [EntityId
] to be stored in collections requiring Default
, like TinyVec
.
impl Default for Errors
impl Default for Event
impl Default for Event
impl Default for Event<()>
impl Default for EventAttributes
impl Default for EventFlags
impl Default for EventKind
impl Default for EventLoop<()>
impl Default for ExpoIn
impl Default for ExpoInOut
impl Default for ExpoOut
impl Default for ExtractKind
impl Default for Extractor
impl Default for FdSet
impl Default for Fill
impl Default for FillRule
impl Default for FilterType
impl Default for FilterType
impl Default for FinderBuilder
impl Default for FiniteF32
impl Default for FiniteF64
impl Default for Flags
impl Default for Flags
impl Default for Flags
impl Default for FlushInfo
impl Default for FnvHasher
impl Default for FontArguments<'_, '_>
impl Default for FontMetrics
impl Default for FontStyle
impl Default for FontStyleState
impl Default for FourByteTag
impl Default for Frame
impl Default for FrameControl
impl Default for FrameInfo
impl Default for FramebufferInfo
impl Default for FsFlags
impl Default for FsFlags
impl Default for FxHasher
impl Default for GeneralPurposeConfig
impl Default for GlobSet
impl Default for GlyphId
impl Default for GlyphId
impl Default for GradientStop
impl Default for GroupInfo
impl Default for Handle<SkBitmap>
impl Default for Handle<SkColorInfo>
impl Default for Handle<SkColorMatrix>
impl Default for Handle<SkFont>
impl Default for Handle<SkImageInfo>
impl Default for Handle<SkOpBuilder>
impl Default for Handle<SkPDF_AttributeList>
impl Default for Handle<SkPDF_Metadata>
impl Default for Handle<SkPaint>
impl Default for Handle<SkPath>
impl Default for Handle<SkPathMeasure>
impl Default for Handle<SkString>
impl Default for Handle<SkYUVAInfo>
impl Default for Handle<SkYUVAPixmapInfo_SupportedDataTypes>
impl Default for Handle<skgpu_MutableTextureState>
impl Default for Handle<skia_textlayout_StrutStyle>
impl Default for Handle<skia_textlayout_TextStyle>
impl Default for Hasher
impl Default for Header
impl Default for HighContrastConfig
impl Default for IPoint
impl Default for IRect
impl Default for ISize
impl Default for Idna
impl Default for ImePurpose
impl Default for InflateState
impl Default for Info<'_>
impl Default for IntegerBounds
impl Default for InvalidBufferSize
impl Default for InvalidOutputSize
impl Default for Iter<'_>
impl Default for KeyInputState
impl Default for KeyState
impl Default for KeyboardEvent
impl Default for LayerAttributes
impl Default for LayoutState
impl Default for Lazy
impl Default for LazyStateID
impl Default for LengthDelimitedCodec
impl Default for LimitSupport
impl Default for Limits
impl Default for Limits
impl Default for Limits
impl Default for LineCap
impl Default for LineJoin
impl Default for Linear
impl Default for LinearGradient
impl Default for LinesCodec
impl Default for LittleEndian
impl Default for LocalPool
impl Default for LocalSet
impl Default for Location
impl Default for LookMatcher
impl Default for LookSet
impl Default for LookSet
impl Default for Lzw
impl Default for M44
impl Default for MatchKind
The default match kind is MatchKind::Standard
.
impl Default for MatchKind
impl Default for MatchKind
impl Default for Matrix
impl Default for Matrix
impl Default for MatrixFlags
impl Default for MatrixFlags
impl Default for MessageDeframer
impl Default for MessageFragmenter
impl Default for MessageSequence
impl Default for Metadata
impl Default for MetadataCommand
impl Default for MissedTickBehavior
impl Default for MmapOptions
impl Default for ModifiersState
impl Default for ModifiersState
impl Default for MouseData
impl Default for NoProxy
impl Default for NoSubscriber
impl Default for NodeBuilder
impl Default for NodeClassSet
impl Default for NodeMask
impl Default for NoneMore
impl Default for NormalizedCoordinate
impl Default for NormalizedF32Exclusive
impl Default for Notify
impl Default for ObjectPath<'_>
impl Default for Once
impl Default for OnceBool
impl Default for OnceNonZeroUsize
impl Default for OpenOptions
impl Default for OpenOptions
impl Default for Options
impl Default for Options
impl Default for Options
impl Default for OverflowMode
impl Default for Override
impl Default for OwnedCanvas<'_>
impl Default for OwnedObjectPath
impl Default for Packbits
impl Default for Paint<'_>
impl Default for Parker
impl Default for Parker
impl Default for ParserBuilder
impl Default for ParserBuilder
impl Default for ParserConfig
impl Default for PartialMsgWriteError
impl Default for Patch3D
impl Default for PathBuilder
impl Default for PathStroker
impl Default for PatternID
impl Default for PatternID
impl Default for PbufferSurface
impl Default for PixelDensity
impl Default for PixelGeometry
impl Default for Pixmap<'_>
impl Default for PixmapPaint
impl Default for PixmapSurface
impl Default for Placeholder
impl Default for PlaceholderAlignment
impl Default for PlaceholderStyle
impl Default for Point
impl Default for Point
impl Default for Point
impl Default for Point
impl Default for Point
impl Default for Point3
impl Default for Policy
impl Default for PollNext
impl Default for PositiveF32
impl Default for PositiveF64
impl Default for PrefilterConfig
impl Default for QuadCoeff
impl Default for QuadIn
impl Default for QuadInOut
impl Default for QuadOut
impl Default for QuartIn
impl Default for QuartInOut
impl Default for QuartOut
impl Default for QuintIn
impl Default for QuintInOut
impl Default for QuintOut
impl Default for RCHandle<SkFontMgr>
impl Default for RCHandle<SkFontStyleSet>
impl Default for RCHandle<SkOrderedFontMgr>
impl Default for RCHandle<SkShader>
impl Default for RCHandle<SkTypeface>
impl Default for RCHandle<skia_textlayout_TypefaceFontProvider>
impl Default for RRect
impl Default for RandomState
impl Default for RawIter<'_>
impl Default for Rect
impl Default for Rect
impl Default for Rect
impl Default for Rect
impl Default for RectHeightStyle
impl Default for RectWidthStyle
impl Default for RefHandle<Sk3DView>
impl Default for RefHandle<SkShaper>
impl Default for RefHandle<skia_textlayout_ParagraphStyle>
impl Default for References
impl Default for ReleaseBehavior
impl Default for RenderCallBody
impl Default for ResolveFlags
impl Default for Resumption
impl Default for Rgbe8Pixel
impl Default for Rng
impl Default for Rng
impl Default for Robustness
impl Default for Role
impl Default for RopeBuilder
impl Default for Sample
impl Default for SamplingOptions
impl Default for ServerConnectionData
impl Default for Sha1Core
impl Default for Shadow
impl Default for ShadowPosition
impl Default for SignalHandler
impl Default for SineIn
impl Default for SineInOut
impl Default for SineOut
impl Default for Size
impl Default for Size
impl Default for SkBlendMode
impl Default for SkBlurStyle
impl Default for SkCanvas_Lattice_RectType
impl Default for SkClipOp
impl Default for SkPaint_Cap
impl Default for SkPaint_Join
impl Default for SkParsePath_PathEncoding
impl Default for SkPathDirection
impl Default for SkTileMode
impl Default for SkYUVColorSpace
impl Default for SmallIndex
impl Default for SpinWait
impl Default for SpreadMode
impl Default for StartKind
impl Default for StateID
impl Default for StateID
impl Default for StorageId
impl Default for StreamingDecoder
impl Default for Stroke
impl Default for StructureElementNode
impl Default for Style
impl Default for Style
impl Default for SurfaceInfo
impl Default for SurfaceProps
impl Default for SurfacePropsFlags
impl Default for Table
impl Default for TestingDOM
impl Default for Text
impl Default for TextDecoration
impl Default for TextEncoding
impl Default for TextNode
impl Default for TextOverflow
impl Default for TextShadow
impl Default for TextureInfo
impl Default for ThreadPoolBuilder<DefaultSpawn>
impl Default for TimeCode
impl Default for Transform
impl Default for Transform
impl Default for Transformations
Instantiate the default transformations, the identity transform.
impl Default for TranslatorBuilder
impl Default for TreeUpdate
impl Default for TypeIdHasher
impl Default for Uncompressed
impl Default for UnicodeRanges
impl Default for UnixCredentials
impl Default for UnixCredentials
impl Default for UnixCredentials
impl Default for UnknownUnit
impl Default for UnparkResult
impl Default for UserAttentionType
impl Default for UserDataMap
impl Default for Utf8PathBuf
impl Default for V2
impl Default for V3
impl Default for V4
impl Default for VPlaceholder
impl Default for ValidationOptions
impl Default for Vec2
impl Default for WaitGroup
impl Default for WatchFlags
impl Default for Weight
impl Default for WheelData
impl Default for WhichCaptures
impl Default for Width
impl Default for WindowAttributes
impl Default for WindowBuilder
impl Default for WindowLevel
impl Default for WindowSurface
impl Default for WindowType
impl Default for World
impl Default for XIAddMasterInfo
impl Default for XIAnyClassInfo
impl Default for XIAnyHierarchyChangeInfo
impl Default for XIAttachSlaveInfo
impl Default for XIBarrierEvent
impl Default for XIBarrierReleasePointerInfo
impl Default for XIButtonClassInfo
impl Default for XIButtonState
impl Default for XIDetachSlaveInfo
impl Default for XIDeviceChangedEvent
impl Default for XIDeviceEvent
impl Default for XIDeviceInfo
impl Default for XIEnterEvent
impl Default for XIEvent
impl Default for XIEventMask
impl Default for XIGrabModifiers
impl Default for XIHierarchyEvent
impl Default for XIHierarchyInfo
impl Default for XIKeyClassInfo
impl Default for XIModifierState
impl Default for XIPropertyEvent
impl Default for XIRawEvent
impl Default for XIRemoveMasterInfo
impl Default for XIScrollClassInfo
impl Default for XITouchClassInfo
impl Default for XITouchOwnershipEvent
impl Default for XIValuatorClassInfo
impl Default for XIValuatorState
impl Default for f32x2
impl Default for skia_textlayout_Affinity
impl Default for skia_textlayout_PositionWithAffinity
impl Default for skia_textlayout_StyleType
impl Default for skia_textlayout_TextAlign
impl Default for skia_textlayout_TextBaseline
impl Default for skia_textlayout_TextDecorationMode
impl Default for skia_textlayout_TextDecorationStyle
impl Default for vec128_storage
impl Default for vec256_storage
impl Default for vec512_storage
impl<'a> Default for &'a BStr
impl<'a> Default for &'a mut BStr
impl<'a> Default for MetadataBuilder<'a>
impl<'a> Default for RecordBuilder<'a>
impl<'a> Default for PrettyFormatter<'a>
impl<'a> Default for Box<'a, str>
impl<'a> Default for DynamicContext<'a>
impl<'a> Default for Executor<'a>
impl<'a> Default for Frame<'a>
impl<'a> Default for LocalExecutor<'a>
impl<'a> Default for Mutations<'a>
impl<'a> Default for Names<'a>
impl<'a> Default for Names<'a>
impl<'a> Default for NodeMaskBuilder<'a>
impl<'a> Default for NonBlocking<'a>
impl<'a> Default for RawFaceTables<'a>
impl<'a> Default for RenderReturn<'a>
impl<'a> Default for SaveLayerRec<'a>
impl<'a> Default for Select<'a>
impl<'a> Default for Str<'a>
impl<'a> Default for Structure<'a>
impl<'a> Default for StructureBuilder<'a>
impl<'a> Default for Subtables<'a>
impl<'a> Default for SubtablesIter<'a>
impl<'a> Default for Table<'a>
impl<'a> Default for Table<'a>
impl<'a> Default for Table<'a>
impl<'a> Default for TrackData<'a>
impl<'a> Default for Tracks<'a>
impl<'a> Default for ValueRecord<'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 LaunchConfig<'a, T>where T: Default + Clone,
impl<'a, T> Default for Box<'a, [T]>
impl<'a, T> Default for OnceRef<'a, T>
impl<'m> Default for MessageFields<'m>
impl<'s, T> Default for SliceVec<'s, T>
impl<A> Default for ArrayVec<A>where A: Array,
impl<A> Default for Map<A>where A: Downcast + ?Sized,
impl<A> Default for SmallVec<A>where A: Array,
impl<A> Default for TinyVec<A>where A: Array,
impl<A, B> Default for Chain<A, B>where A: Default, B: Default,
impl<B> Default for Cow<'_, B>where B: ToOwned + ?Sized, <B as ToOwned>::Owned: Default,
impl<B> Default for Control<B>
The default is Continue
.
impl<B> Default for Collected<B>
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,
impl<C> Default for JoinMultiple<C>where C: Default,
impl<C> Default for JoinMultiplePin<C>where C: Default,
impl<Ctx> Default for freya::prelude::Config<Ctx>where Ctx: HotReloadingContext,
impl<D> Default for http_body::empty::Empty<D>
impl<D> Default for Full<D>where D: Buf,
impl<D, E> Default for BoxBody<D, E>where D: Buf + 'static,
impl<D, E> Default for UnsyncBoxBody<D, E>where D: Buf + 'static,
impl<E, 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>
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>where I: Default + Iterator, <I as Iterator>::Item: IntoIterator,
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<Inner, Value> Default for Recursive<Inner, Value>where Inner: Default, Value: Default,
impl<Ix> Default for EdgeIndex<Ix>where Ix: Default,
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,
impl<K, V> Default for &indexmap::map::slice::Slice<K, V>
impl<K, V> Default for &mut indexmap::map::slice::Slice<K, V>
impl<K, V> Default for alloc::boxed::Box<Slice<K, V>, Global>
impl<K, V> Default for BTreeMap<K, V, Global>
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 alloc::collections::btree::map::Values<'_, K, V>
impl<K, V> Default for indexmap::map::iter::IntoIter<K, V>
impl<K, V> Default for indexmap::map::iter::IntoKeys<K, V>
impl<K, V> Default for indexmap::map::iter::IntoValues<K, V>
impl<K, V> Default for indexmap::map::iter::Iter<'_, K, V>
impl<K, V> Default for indexmap::map::iter::IterMut<'_, K, V>
impl<K, V> Default for indexmap::map::iter::Keys<'_, K, V>
impl<K, V> Default for indexmap::map::iter::Values<'_, K, V>
impl<K, V> Default for ValuesMut<'_, K, V>
impl<K, V> Default for SlotMap<K, V>where K: Key,
impl<K, V> Default for DenseSlotMap<K, V>where K: Key,
impl<K, V> Default for HopSlotMap<K, V>where K: Key,
impl<K, V> Default for SecondaryMap<K, V>where K: Key,
impl<K, V, A> Default for alloc::collections::btree::map::IntoIter<K, V, A>where A: Allocator + Default + Clone,
impl<K, V, A> Default for alloc::collections::btree::map::IntoKeys<K, V, A>where A: Allocator + Default + Clone,
impl<K, V, A> Default for alloc::collections::btree::map::IntoValues<K, V, A>where A: Allocator + Default + Clone,
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> Default for SparseSecondaryMap<K, V, S>where K: Key, S: BuildHasher + 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,
impl<Key> Default for Torin<Key>where Key: NodeKey,
impl<M> Default for Builder<M>where M: Default,
impl<Meta> Default for ObjectMap<Meta>where Meta: Default + ObjectMetadata,
impl<N> Default for TarjanScc<N>
impl<N, E, Ty> Default for GraphMap<N, E, Ty>where N: NodeTrait, Ty: EdgeType,
Create a new empty GraphMap
.
impl<N, E, Ty, Ix> Default for Csr<N, E, Ty, Ix>where Ty: EdgeType, Ix: IndexType,
impl<N, E, Ty, Ix> Default for StableGraph<N, E, Ty, Ix>where Ty: EdgeType, Ix: IndexType,
Create a new empty StableGraph
.
impl<N, E, Ty, Ix> Default for Graph<N, E, Ty, Ix>where Ty: EdgeType, Ix: IndexType,
Create a new empty Graph
.
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
.
impl<N, VM> Default for DfsSpace<N, VM>where VM: VisitMap<N> + Default,
impl<N, VM> Default for Bfs<N, VM>where VM: Default,
impl<N, VM> Default for Dfs<N, VM>where VM: Default,
impl<N, VM> Default for DfsPostOrder<N, VM>where VM: Default,
impl<N, VM> Default for Topo<N, VM>where VM: Default,
impl<P> Default for LogicalPosition<P>where P: Default,
impl<P> Default for LogicalSize<P>where P: Default,
impl<P> Default for PhysicalPosition<P>where P: Default,
impl<P> Default for PhysicalSize<P>where P: Default,
impl<P, Container> Default for ImageBuffer<P, Container>where P: Pixel, Container: 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,
impl<St> Default for SelectAll<St>where St: Stream + Unpin,
impl<Storage> Default for __BindgenBitfieldUnit<Storage>where Storage: Default,
impl<Storage> Default for __BindgenBitfieldUnit<Storage>where Storage: Default,
impl<T> Default for &[T]
impl<T> Default for &indexmap::set::slice::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 (T₁, T₂, …, Tₙ)where T: Default,
This trait is implemented for tuples up to twelve items long.
impl<T> Default for alloc::boxed::Box<[T], Global>
impl<T> Default for alloc::boxed::Box<Slice<T>, Global>
impl<T> Default for alloc::boxed::Box<T, Global>where T: Default,
impl<T> Default for BinaryHeap<T, Global>where T: Ord,
impl<T> Default for alloc::collections::binary_heap::IntoIter<T, Global>
impl<T> Default for BTreeSet<T, Global>
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, Global>
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, Global>
impl<T> Default for VecDeque<T, Global>
impl<T> Default for Rc<T, Global>where T: Default,
impl<T> Default for alloc::rc::Weak<T, Global>
impl<T> Default for Arc<T, Global>where T: Default,
impl<T> Default for alloc::sync::Weak<T, Global>
impl<T> Default for Vec<T, Global>
impl<T> Default for LazyCell<T, fn() -> 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 core::cell::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 ManuallyDrop<T>where T: Default + ?Sized,
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 core::slice::iter::Iter<'_, T>
impl<T> Default for core::slice::iter::IterMut<'_, T>
impl<T> Default for AtomicPtr<T>
impl<T> Default for Exclusive<T>where T: Default + ?Sized,
impl<T> Default for std::io::cursor::Cursor<T>where T: Default,
impl<T> Default for LazyLock<T, fn() -> T>where T: Default,
impl<T> Default for std::sync::mutex::Mutex<T>where T: Default + ?Sized,
impl<T> Default for OnceLock<T>
impl<T> Default for std::sync::rwlock::RwLock<T>where T: Default,
impl<T> Default for HeaderMap<T>
impl<T> Default for Request<T>where T: Default,
impl<T> Default for Response<T>where T: Default,
impl<T> Default for HttpsConnector<T>where T: Default,
impl<T> Default for indexmap::set::iter::IntoIter<T>
impl<T> Default for indexmap::set::iter::Iter<'_, T>
impl<T> Default for Ratio<T>where T: Clone + Integer,
impl<T> Default for NotZero<T>where T: Zero,
impl<T> Default for EventHandler<'_, T>
impl<T> Default for LaunchConfigBuilder<'_, T>
impl<T> Default for freya::prelude::RefCell<T>where T: Default,
impl<T> Default for WindowConfig<T>where T: Clone,
impl<T> Default for AlgSetKey<T>
impl<T> Default for AlgSetKey<T>
impl<T> Default for AlgSetKey<T>
impl<T> Default for Angle<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 BitFlags<T, <T as RawBitFlags>::Numeric>where T: BitFlag,
The default value returned is one with all flags unset, i. e. [empty
][Self::empty],
unless customized.