pub trait Hash {
// Required method
fn hash<H>(&self, state: &mut H)
where H: Hasher;
// Provided method
fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher,
Self: Sized { ... }
}
Expand description
A hashable type.
Types implementing Hash
are able to be hash
ed with an instance of
Hasher
.
Implementing Hash
You can derive Hash
with #[derive(Hash)]
if all fields implement Hash
.
The resulting hash will be the combination of the values from calling
hash
on each field.
#[derive(Hash)]
struct Rustacean {
name: String,
country: String,
}
If you need more control over how a value is hashed, you can of course
implement the Hash
trait yourself:
use std::hash::{Hash, Hasher};
struct Person {
id: u32,
name: String,
phone: u64,
}
impl Hash for Person {
fn hash<H: Hasher>(&self, state: &mut H) {
self.id.hash(state);
self.phone.hash(state);
}
}
Hash
and Eq
When implementing both Hash
and Eq
, it is important that the following
property holds:
k1 == k2 -> hash(k1) == hash(k2)
In other words, if two keys are equal, their hashes must also be equal.
HashMap
and HashSet
both rely on this behavior.
Thankfully, you won’t need to worry about upholding this property when
deriving both Eq
and Hash
with #[derive(PartialEq, Eq, Hash)]
.
Prefix collisions
Implementations of hash
should ensure that the data they
pass to the Hasher
are prefix-free. That is,
unequal values should cause two different sequences of values to be written,
and neither of the two sequences should be a prefix of the other.
For example, the standard implementation of Hash
for &str
passes an extra
0xFF
byte to the Hasher
so that the values ("ab", "c")
and ("a", "bc")
hash differently.
Portability
Due to differences in endianness and type sizes, data fed by Hash
to a Hasher
should not be considered portable across platforms. Additionally the data passed by most
standard library types should not be considered stable between compiler versions.
This means tests shouldn’t probe hard-coded hash values or data fed to a Hasher
and
instead should check consistency with Eq
.
Serialization formats intended to be portable between platforms or compiler versions should
either avoid encoding hashes or only rely on Hash
and Hasher
implementations that
provide additional guarantees.
Required Methods§
Provided Methods§
1.3.0 · sourcefn hash_slice<H>(data: &[Self], state: &mut H)where
H: Hasher,
Self: Sized,
fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,
Feeds a slice of this type into the given Hasher
.
This method is meant as a convenience, but its implementation is
also explicitly left unspecified. It isn’t guaranteed to be
equivalent to repeated calls of hash
and implementations of
Hash
should keep that in mind and call hash
themselves
if the slice isn’t treated as a whole unit in the PartialEq
implementation.
For example, a VecDeque
implementation might naïvely call
as_slices
and then hash_slice
on each slice, but this
is wrong since the two slices can change with a call to
make_contiguous
without affecting the PartialEq
result. Since these slices aren’t treated as singular
units, and instead part of a larger deque, this method cannot
be used.
Examples
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
let mut hasher = DefaultHasher::new();
let numbers = [6, 28, 496, 8128];
Hash::hash_slice(&numbers, &mut hasher);
println!("Hash is {:x}!", hasher.finish());
Implementors§
impl Hash for Code
impl Hash for Color
impl Hash for Handled
impl Hash for druid::Location
impl Hash for RawWindowHandle
impl Hash for druid::text::Direction
impl Hash for druid::text::ImeInvalidation
impl Hash for Movement
impl Hash for druid::text::TextAction
impl Hash for VerticalMovement
impl Hash for WritingDirection
impl Hash for FontStyle
impl Hash for ColorType
impl Hash for ExtendedColorType
impl Hash for ImageFormat
impl Hash for ImageFormatHint
impl Hash for LimitErrorKind
impl Hash for ParameterErrorKind
impl Hash for UnsupportedErrorKind
impl Hash for druid::piet::image_crate::flat::Error
impl Hash for NormalForm
impl Hash for ChecksumType
impl Hash for ConvertError
impl Hash for DateMonth
impl Hash for DateWeekday
impl Hash for FileError
impl Hash for KeyFileError
impl Hash for LogWriterOutput
impl Hash for MarkupError
impl Hash for OptionArg
impl Hash for SeekType
impl Hash for TimeType
impl Hash for UnicodeScript
impl Hash for UserDirectory
impl Hash for VariantClass
impl Hash for druid::piet::cairo::glib::bitflags::_core::cmp::Ordering
impl Hash for Infallible
impl Hash for IpAddr
impl Hash for Ipv6MulticastScope
impl Hash for SocketAddr
impl Hash for Which
impl Hash for druid::piet::cairo::glib::bitflags::_core::sync::atomic::Ordering
impl Hash for ErrorKind
impl Hash for FluentNumberCurrencyDisplayStyle
impl Hash for FluentNumberStyle
impl Hash for log::Level
impl Hash for log::LevelFilter
impl Hash for bool
impl Hash for char
impl Hash for i8
impl Hash for i16
impl Hash for i32
impl Hash for i64
impl Hash for i128
impl Hash for isize
impl Hash for !
impl Hash for str
impl Hash for u8
impl Hash for u16
impl Hash for u32
impl Hash for u64
impl Hash for u128
impl Hash for ()
impl Hash for usize
impl Hash for KeyEvent
impl Hash for druid::Modifiers
impl Hash for TimerToken
impl Hash for WindowId
impl Hash for WidgetId
impl Hash for SampleLayout
impl Hash for LimitSupport
impl Hash for Limits
impl Hash for Rect
impl Hash for druid::piet::FontFamily
impl Hash for FontWeight
impl Hash for GradientStop
impl Hash for FontOptions
impl Hash for PdfOutline
impl Hash for passwd
impl Hash for ObjectRef
impl Hash for Binding
impl Hash for BindingFlags
impl Hash for BoxedAnyObject
impl Hash for ByteArray
impl Hash for Bytes
impl Hash for Checksum
impl Hash for Closure
impl Hash for Date
impl Hash for DateTime
impl Hash for druid::piet::cairo::glib::Error
impl Hash for FormatSizeFlags
impl Hash for GStr
impl Hash for GString
impl Hash for GStringBuilder
impl Hash for ILong
impl Hash for IOCondition
impl Hash for InitiallyUnowned
impl Hash for KeyFile
impl Hash for KeyFileFlags
impl Hash for LogLevelFlags
impl Hash for LogLevels
impl Hash for MainContext
impl Hash for MainLoop
impl Hash for MarkupParseContext
impl Hash for druid::piet::cairo::glib::Object
impl Hash for OptionFlags
impl Hash for ParamFlags
impl Hash for ParamSpec
impl Hash for ParamSpecBoolean
impl Hash for ParamSpecBoxed
impl Hash for ParamSpecChar
impl Hash for ParamSpecDouble
impl Hash for ParamSpecEnum
impl Hash for ParamSpecFlags
impl Hash for ParamSpecFloat
impl Hash for ParamSpecGType
impl Hash for ParamSpecInt64
impl Hash for ParamSpecInt
impl Hash for ParamSpecLong
impl Hash for ParamSpecObject
impl Hash for ParamSpecOverride
impl Hash for ParamSpecParam
impl Hash for ParamSpecPointer
impl Hash for ParamSpecString
impl Hash for ParamSpecUChar
impl Hash for ParamSpecUInt64
impl Hash for ParamSpecUInt
impl Hash for ParamSpecULong
impl Hash for ParamSpecUnichar
impl Hash for ParamSpecValueArray
impl Hash for ParamSpecVariant
impl Hash for Quark
impl Hash for RustClosure
impl Hash for SignalFlags
impl Hash for Source
impl Hash for SpawnFlags
impl Hash for TimeSpan
impl Hash for TimeZone
impl Hash for Type
impl Hash for ULong
impl Hash for druid::piet::cairo::glib::Variant
impl Hash for VariantTy
impl Hash for VariantType
impl Hash for SignalId
impl Hash for SignalType
impl Hash for Handle
impl Hash for ObjectPath
impl Hash for Signature
impl Hash for druid::piet::cairo::glib::bitflags::_core::alloc::Layout
impl Hash for TypeId
impl Hash for CStr
impl Hash for druid::piet::cairo::glib::bitflags::_core::fmt::Error
impl Hash for PhantomPinned
impl Hash for Ipv4Addr
impl Hash for Ipv6Addr
impl Hash for SocketAddrV4
impl Hash for SocketAddrV6
impl Hash for NonZeroI8
impl Hash for NonZeroI16
impl Hash for NonZeroI32
impl Hash for NonZeroI64
impl Hash for NonZeroI128
impl Hash for NonZeroIsize
impl Hash for NonZeroU8
impl Hash for NonZeroU16
impl Hash for NonZeroU32
impl Hash for NonZeroU64
impl Hash for NonZeroU128
impl Hash for NonZeroUsize
impl Hash for RangeFull
impl Hash for druid::piet::cairo::glib::bitflags::_core::ptr::Alignment
impl Hash for Duration
impl Hash for CString
impl Hash for String
impl Hash for OsStr
impl Hash for OsString
impl Hash for std::fs::FileType
impl Hash for UCred
impl Hash for Path
impl Hash for PathBuf
impl Hash for PrefixComponent<'_>
impl Hash for ThreadId
impl Hash for Instant
impl Hash for SystemTime
impl Hash for FileDialogToken
impl Hash for IdleToken
impl Hash for TextFieldToken
impl Hash for FluentNumberOptions
impl Hash for Identifier
impl Hash for Field
impl Hash for tracing_core::metadata::Level
impl Hash for tracing_core::metadata::LevelFilter
impl Hash for Id
impl Hash for Span
impl Hash for ATerm
impl Hash for B0
impl Hash for B1
impl Hash for Z0
impl Hash for Equal
impl Hash for Greater
impl Hash for Less
impl Hash for UTerm
impl Hash for AboutDialog
impl Hash for AccelFlags
impl Hash for AccelGroup
impl Hash for AccelLabel
impl Hash for Action
impl Hash for Action
impl Hash for ActionBar
impl Hash for ActionGroup
impl Hash for ActionMap
impl Hash for Actionable
impl Hash for Adjustment
impl Hash for Advice
impl Hash for Align
impl Hash for Alignment
impl Hash for AnchorHints
impl Hash for AndroidDisplayHandle
impl Hash for AndroidNdkWindowHandle
impl Hash for AnyExtension
impl Hash for AppChooser
impl Hash for AppChooserButton
impl Hash for AppChooserDialog
impl Hash for AppChooserWidget
impl Hash for AppInfo
impl Hash for AppInfoCreateFlags
impl Hash for AppInfoMonitor
impl Hash for AppKitDisplayHandle
impl Hash for AppKitWindowHandle
impl Hash for AppLaunchContext
impl Hash for AppLaunchContext
impl Hash for Application
impl Hash for Application
impl Hash for ApplicationCommandLine
impl Hash for ApplicationFlags
impl Hash for ApplicationInhibitFlags
impl Hash for ApplicationWindow
impl Hash for ArrowType
impl Hash for AskPasswordFlags
impl Hash for AspectFrame
impl Hash for Assistant
impl Hash for AssistantPageType
impl Hash for AsyncInitable
impl Hash for AsyncResult
impl Hash for AttrType
impl Hash for Attribute
impl Hash for AxisFlags
impl Hash for AxisUse
impl Hash for BaselinePosition
impl Hash for BidiClass
impl Hash for BidiControl
impl Hash for BidiMirrored
impl Hash for BidiType
impl Hash for Bin
impl Hash for BorderStyle
impl Hash for Box
impl Hash for BufferClusterLevel
impl Hash for BufferedInputStream
impl Hash for BufferedOutputStream
impl Hash for Buildable
impl Hash for Builder
impl Hash for BuilderError
impl Hash for BusNameOwnerFlags
impl Hash for BusNameWatcherFlags
impl Hash for BusType
impl Hash for Button
impl Hash for ButtonBox
impl Hash for ButtonBoxStyle
impl Hash for ButtonRole
impl Hash for ButtonsType
impl Hash for ByteOrder
impl Hash for BytesIcon
impl Hash for Calendar
impl Hash for CalendarDisplayOptions
impl Hash for Cancellable
impl Hash for CellArea
impl Hash for CellAreaBox
impl Hash for CellAreaContext
impl Hash for CellEditable
impl Hash for CellLayout
impl Hash for CellRenderer
impl Hash for CellRendererAccel
impl Hash for CellRendererAccelMode
impl Hash for CellRendererCombo
impl Hash for CellRendererMode
impl Hash for CellRendererPixbuf
impl Hash for CellRendererProgress
impl Hash for CellRendererSpin
impl Hash for CellRendererSpinner
impl Hash for CellRendererState
impl Hash for CellRendererText
impl Hash for CellRendererToggle
impl Hash for CellView
impl Hash for CharsetConverter
impl Hash for CheckButton
impl Hash for CheckMenuItem
impl Hash for CheckedCastError
impl Hash for ChunkType
impl Hash for Clipboard
impl Hash for ColorButton
impl Hash for ColorChooser
impl Hash for ColorChooserDialog
impl Hash for ColorChooserWidget
impl Hash for ColorTransform
impl Hash for Colorspace
impl Hash for ComboBox
impl Hash for ComboBoxText
impl Hash for Component
impl Hash for CompositionEvent
impl Hash for CompositionState
impl Hash for CompressionLevel
impl Hash for CompressionStrategy
impl Hash for Container
impl Hash for Context
impl Hash for Converter
impl Hash for ConverterFlags
impl Hash for ConverterInputStream
impl Hash for ConverterOutputStream
impl Hash for ConverterResult
impl Hash for CoordType
impl Hash for CornerType
impl Hash for Coverage
impl Hash for CoverageLevel
impl Hash for Credentials
impl Hash for CredentialsType
impl Hash for CrossingMode
impl Hash for CssProvider
impl Hash for CssProviderError
impl Hash for CssSection
impl Hash for CssSectionType
impl Hash for Cursor
impl Hash for CursorType
impl Hash for DBusActionGroup
impl Hash for DBusArgInfo
impl Hash for DBusAuthObserver
impl Hash for DBusCallFlags
impl Hash for DBusCapabilityFlags
impl Hash for DBusConnection
impl Hash for DBusConnectionFlags
impl Hash for DBusInterface
impl Hash for DBusInterfaceInfo
impl Hash for DBusInterfaceSkeleton
impl Hash for DBusInterfaceSkeletonFlags
impl Hash for DBusMenuModel
impl Hash for DBusMessage
impl Hash for DBusMessageByteOrder
impl Hash for DBusMessageFlags
impl Hash for DBusMessageHeaderField
impl Hash for DBusMessageType
impl Hash for DBusMethodInfo
impl Hash for DBusMethodInvocation
impl Hash for DBusNodeInfo
impl Hash for DBusObject
impl Hash for DBusPropertyInfo
impl Hash for DBusProxy
impl Hash for DBusProxyFlags
impl Hash for DBusSendMessageFlags
impl Hash for DBusServer
impl Hash for DBusServerFlags
impl Hash for DBusSignalFlags
impl Hash for DBusSignalInfo
impl Hash for DataFormat
impl Hash for DataInputStream
impl Hash for DataOutputStream
impl Hash for DataStreamByteOrder
impl Hash for DataStreamNewlineType
impl Hash for DeleteType
impl Hash for DesktopAppInfo
impl Hash for DestDefaults
impl Hash for Device
impl Hash for DeviceManager
impl Hash for DevicePad
impl Hash for DevicePadFeature
impl Hash for DeviceTool
impl Hash for DeviceToolType
impl Hash for DeviceType
impl Hash for Dialog
impl Hash for DialogFlags
impl Hash for Direction
impl Hash for Direction
impl Hash for DirectionType
impl Hash for Display
impl Hash for DisplayManager
impl Hash for Dl_info
impl Hash for Document
impl Hash for DragAction
impl Hash for DragCancelReason
impl Hash for DragContext
impl Hash for DragProtocol
impl Hash for DragResult
impl Hash for DrawingArea
impl Hash for DrawingContext
impl Hash for Drive
impl Hash for DriveStartFlags
impl Hash for DriveStartStopType
impl Hash for DrmDisplayHandle
impl Hash for DrmWindowHandle
impl Hash for Editable
impl Hash for EditableText
impl Hash for Elf32_Chdr
impl Hash for Elf32_Ehdr
impl Hash for Elf32_Phdr
impl Hash for Elf32_Shdr
impl Hash for Elf32_Sym
impl Hash for Elf64_Chdr
impl Hash for Elf64_Ehdr
impl Hash for Elf64_Phdr
impl Hash for Elf64_Shdr
impl Hash for Elf64_Sym
impl Hash for EllipsizeMode
impl Hash for Emblem
impl Hash for EmblemOrigin
impl Hash for EmblemedIcon
impl Hash for Entry
impl Hash for EntryBuffer
impl Hash for EntryCompletion
impl Hash for EntryIconPosition
impl Hash for Error
impl Hash for Error
impl Hash for Error
impl Hash for Error
impl Hash for Event
impl Hash for EventBox
impl Hash for EventButton
impl Hash for EventConfigure
impl Hash for EventController
impl Hash for EventCrossing
impl Hash for EventDND
impl Hash for EventExpose
impl Hash for EventFocus
impl Hash for EventGrabBroken
impl Hash for EventKey
impl Hash for EventMask
impl Hash for EventMotion
impl Hash for EventOwnerChange
impl Hash for EventPadAxis
impl Hash for EventPadButton
impl Hash for EventPadGroupMode
impl Hash for EventProperty
impl Hash for EventProximity
impl Hash for EventScroll
impl Hash for EventSelection
impl Hash for EventSequence
impl Hash for EventSequenceState
impl Hash for EventSetting
impl Hash for EventTouch
impl Hash for EventTouchpadPinch
impl Hash for EventTouchpadSwipe
impl Hash for EventType
impl Hash for EventVisibility
impl Hash for EventWindowState
impl Hash for Expander
impl Hash for File
impl Hash for FileAttributeInfoFlags
impl Hash for FileAttributeInfoList
impl Hash for FileAttributeMatcher
impl Hash for FileAttributeStatus
impl Hash for FileAttributeType
impl Hash for FileChooser
impl Hash for FileChooserAction
impl Hash for FileChooserButton
impl Hash for FileChooserConfirmation
impl Hash for FileChooserDialog
impl Hash for FileChooserError
impl Hash for FileChooserNative
impl Hash for FileChooserWidget
impl Hash for FileCopyFlags
impl Hash for FileCreateFlags
impl Hash for FileEnumerator
impl Hash for FileFilter
impl Hash for FileFilterFlags
impl Hash for FileIOStream
impl Hash for FileIcon
impl Hash for FileInfo
impl Hash for FileInputStream
impl Hash for FileMeasureFlags
impl Hash for FileMonitor
impl Hash for FileMonitorEvent
impl Hash for FileMonitorFlags
impl Hash for FileOutputStream
impl Hash for FileQueryInfoFlags
impl Hash for FileType
impl Hash for FilenameCompleter
impl Hash for FilterInputStream
impl Hash for FilterOutputStream
impl Hash for FiniteF32
impl Hash for FiniteF64
impl Hash for Fixed
impl Hash for FlowBox
impl Hash for FlowBoxChild
impl Hash for Font
impl Hash for Font
impl Hash for FontButton
impl Hash for FontChooser
impl Hash for FontChooserDialog
impl Hash for FontChooserWidget
impl Hash for FontDescription
impl Hash for FontFace
impl Hash for FontFamily
impl Hash for FontMap
impl Hash for FontMap
impl Hash for FontMask
impl Hash for FontMetrics
impl Hash for Fontset
impl Hash for FontsetSimple
impl Hash for Frame
impl Hash for FrameClock
impl Hash for FrameClockPhase
impl Hash for FrameTimings
impl Hash for FullscreenMode
impl Hash for GLArea
impl Hash for GLContext
impl Hash for GLError
impl Hash for GObjectAccessible
impl Hash for GbmDisplayHandle
impl Hash for GbmWindowHandle
impl Hash for GeneralCategory
impl Hash for Gesture
impl Hash for GestureDrag
impl Hash for GestureLongPress
impl Hash for GestureMultiPress
impl Hash for GesturePan
impl Hash for GestureRotate
impl Hash for GestureSingle
impl Hash for GestureSwipe
impl Hash for GestureZoom
impl Hash for GlyphClass
impl Hash for GlyphId
impl Hash for GlyphItem
impl Hash for GlyphString
impl Hash for GrabOwnership
impl Hash for GrabStatus
impl Hash for Gravity
impl Hash for Gravity
impl Hash for GravityHint
impl Hash for Grid
impl Hash for HaikuDisplayHandle
impl Hash for HaikuWindowHandle
impl Hash for HeaderBar
impl Hash for HitPosition
impl Hash for Hyperlink
impl Hash for HyperlinkImpl
impl Hash for HyperlinkStateFlags
impl Hash for Hypertext
impl Hash for ID
impl Hash for IMContext
impl Hash for IMContextSimple
impl Hash for IMMulticontext
impl Hash for IOErrorEnum
impl Hash for IOStream
impl Hash for IOStreamSpliceFlags
impl Hash for Icon
impl Hash for IconInfo
impl Hash for IconLookupFlags
impl Hash for IconSize
impl Hash for IconTheme
impl Hash for IconThemeError
impl Hash for IconView
impl Hash for IconViewDropPosition
impl Hash for Image
impl Hash for Image
impl Hash for ImageType
impl Hash for InetAddress
impl Hash for InetAddressMask
impl Hash for InetSocketAddress
impl Hash for InfoBar
impl Hash for Initable
impl Hash for InputHints
impl Hash for InputMode
impl Hash for InputPurpose
impl Hash for InputSource
impl Hash for InputStream
impl Hash for InterpType
impl Hash for Invisible
impl Hash for Item
impl Hash for JunctionSides
impl Hash for Justification
impl Hash for Key
impl Hash for Key
impl Hash for KeyState
impl Hash for KeyboardEvent
impl Hash for Keymap
impl Hash for Label
impl Hash for Language
impl Hash for Language
impl Hash for Language
impl Hash for LanguageIdentifier
impl Hash for Layer
impl Hash for Layout
impl Hash for Layout
impl Hash for LayoutIter
impl Hash for LayoutLine
impl Hash for Level
impl Hash for LevelBar
impl Hash for LevelBarMode
impl Hash for License
impl Hash for LinkButton
impl Hash for ListBox
impl Hash for ListBoxRow
impl Hash for ListModel
impl Hash for ListStore
impl Hash for ListStore
impl Hash for LoadableIcon
impl Hash for LockButton
impl Hash for MZError
impl Hash for MZFlush
impl Hash for MZStatus
impl Hash for MemoryInputStream
impl Hash for MemoryOutputStream
impl Hash for Menu
impl Hash for Menu
impl Hash for MenuAttributeIter
impl Hash for MenuBar
impl Hash for MenuButton
impl Hash for MenuDirectionType
impl Hash for MenuItem
impl Hash for MenuItem
impl Hash for MenuLinkIter
impl Hash for MenuModel
impl Hash for MenuShell
impl Hash for MenuToolButton
impl Hash for MessageDialog
impl Hash for MessageType
impl Hash for Misc
impl Hash for Misc
impl Hash for ModelButton
impl Hash for ModifierIntent
impl Hash for ModifierType
impl Hash for Modifiers
impl Hash for Monitor
impl Hash for Mount
impl Hash for MountMountFlags
impl Hash for MountOperation
impl Hash for MountOperation
impl Hash for MountOperationResult
impl Hash for MountUnmountFlags
impl Hash for MovementStep
impl Hash for NativeDialog
impl Hash for NetworkAddress
impl Hash for NetworkConnectivity
impl Hash for NetworkMonitor
impl Hash for NetworkService
impl Hash for NoOpObject
impl Hash for NoOpObjectFactory
impl Hash for Node<'_, '_>
impl Hash for Node<'_, '_>
impl Hash for NodeId
impl Hash for NodeId
impl Hash for NonZeroPositiveF32
impl Hash for NonZeroPositiveF64
impl Hash for NormalizedF32
impl Hash for NormalizedF64
impl Hash for Notebook
impl Hash for NotebookTab
impl Hash for Notification
impl Hash for NotificationPriority
impl Hash for NotifyType
impl Hash for NumberUpLayout
impl Hash for Object
impl Hash for ObjectFactory
impl Hash for OffscreenWindow
impl Hash for OrbitalDisplayHandle
impl Hash for OrbitalWindowHandle
impl Hash for Orientable
impl Hash for Orientation
impl Hash for OutputStream
impl Hash for OutputStreamSpliceFlags
impl Hash for Overlay
impl Hash for OwnerChange
impl Hash for PackDirection
impl Hash for PackType
impl Hash for PadActionType
impl Hash for PadController
impl Hash for PageOrientation
impl Hash for PageSet
impl Hash for PageSetup
impl Hash for PanDirection
impl Hash for Paned
impl Hash for PaperSize
impl Hash for ParagraphInfo
impl Hash for PasswordSave
impl Hash for Permission
impl Hash for Permissions
impl Hash for Pixbuf
impl Hash for PixbufAlphaMode
impl Hash for PixbufAnimation
impl Hash for PixbufAnimationIter
impl Hash for PixbufError
impl Hash for PixbufFormat
impl Hash for PixbufFormatFlags
impl Hash for PixbufLoader
impl Hash for PixbufNonAnim
impl Hash for PixbufRotation
impl Hash for PixbufSimpleAnim
impl Hash for PlacesOpenFlags
impl Hash for PlacesSidebar
impl Hash for Plug
impl Hash for Plug
impl Hash for PluralRuleType
impl Hash for PodCastError
impl Hash for PolicyType
impl Hash for PollNext
impl Hash for PollableInputStream
impl Hash for PollableOutputStream
impl Hash for Popover
impl Hash for PopoverConstraint
impl Hash for PopoverMenu
impl Hash for PositionType
impl Hash for PositiveF32
impl Hash for PositiveF64
impl Hash for PrintContext
impl Hash for PrintDuplex
impl Hash for PrintError
impl Hash for PrintOperation
impl Hash for PrintOperationAction
impl Hash for PrintOperationPreview
impl Hash for PrintOperationResult
impl Hash for PrintPages
impl Hash for PrintQuality
impl Hash for PrintSettings
impl Hash for PrintStatus
impl Hash for ProgressBar
impl Hash for PropMode
impl Hash for PropagationPhase
impl Hash for PropertyAction
impl Hash for PropertyState
impl Hash for Proxy
impl Hash for ProxyAddress
impl Hash for ProxyResolver
impl Hash for RGBA
impl Hash for RadioButton
impl Hash for RadioMenuItem
impl Hash for RadioToolButton
impl Hash for Range
impl Hash for Range
impl Hash for RawDisplayHandle
impl Hash for ReadInputStream
impl Hash for RecentChooser
impl Hash for RecentChooserDialog
impl Hash for RecentChooserError
impl Hash for RecentChooserMenu
impl Hash for RecentChooserWidget
impl Hash for RecentFilter
impl Hash for RecentFilterFlags
impl Hash for RecentInfo
impl Hash for RecentManager
impl Hash for RecentManagerError
impl Hash for RecentSortType
impl Hash for Rectangle
impl Hash for Region
impl Hash for RegionFlags
impl Hash for Registry
impl Hash for Relation
impl Hash for RelationSet
impl Hash for RelationType
impl Hash for ReliefStyle
impl Hash for RemoteActionGroup
impl Hash for RenderPart
impl Hash for Renderer
impl Hash for ResizeMode
impl Hash for Resolver
impl Hash for ResolverError
impl Hash for ResolverRecordType
impl Hash for Resource
impl Hash for ResourceError
impl Hash for ResourceLookupFlags
impl Hash for ResponseType
impl Hash for Revealer
impl Hash for RevealerTransitionType
impl Hash for Role
impl Hash for Scale
impl Hash for ScaleButton
impl Hash for Screen
impl Hash for Script
impl Hash for Script
impl Hash for Script
impl Hash for Script
impl Hash for ScriptExtension
impl Hash for ScriptMetrics
impl Hash for ScrollDirection
impl Hash for ScrollStep
impl Hash for ScrollType
impl Hash for Scrollable
impl Hash for ScrollablePolicy
impl Hash for Scrollbar
impl Hash for ScrolledWindow
impl Hash for SearchBar
impl Hash for SearchEntry
impl Hash for Seat
impl Hash for SeatCapabilities
impl Hash for Seekable
impl Hash for Selection
impl Hash for SelectionData
impl Hash for SelectionMode
impl Hash for SensitivityType
impl Hash for Separator
impl Hash for SeparatorMenuItem
impl Hash for SeparatorToolItem
impl Hash for SerializeFlags
impl Hash for SettingAction
impl Hash for Settings
impl Hash for Settings
impl Hash for SettingsBackend
impl Hash for SettingsBindFlags
impl Hash for SettingsSchema
impl Hash for SettingsSchemaKey
impl Hash for SettingsSchemaSource
impl Hash for ShadowType
impl Hash for ShapeFlags
impl Hash for ShortcutLabel
impl Hash for ShortcutType
impl Hash for ShortcutsGroup
impl Hash for ShortcutsSection
impl Hash for ShortcutsShortcut
impl Hash for ShortcutsWindow
impl Hash for ShowFlags
impl Hash for SimpleAction
impl Hash for SimpleActionGroup
impl Hash for SimpleIOStream
impl Hash for SimplePermission
impl Hash for SimpleProxyResolver
impl Hash for SizeGroup
impl Hash for SizeGroupMode
impl Hash for SizeRequestMode
impl Hash for Socket
impl Hash for Socket
impl Hash for Socket
impl Hash for SocketAddress
impl Hash for SocketAddressEnumerator
impl Hash for SocketClient
impl Hash for SocketClientEvent
impl Hash for SocketConnectable
impl Hash for SocketConnection
impl Hash for SocketFamily
impl Hash for SocketListener
impl Hash for SocketListenerEvent
impl Hash for SocketProtocol
impl Hash for SocketService
impl Hash for SocketType
impl Hash for SortColumn
impl Hash for SortType
impl Hash for SpinButton
impl Hash for SpinButtonUpdatePolicy
impl Hash for SpinType
impl Hash for Spinner
impl Hash for SrvTarget
impl Hash for Stack
impl Hash for StackSidebar
impl Hash for StackSwitcher
impl Hash for StackTransitionType
impl Hash for StateFlags
impl Hash for StateSet
impl Hash for StateType
impl Hash for Statusbar
impl Hash for StreamError
impl Hash for StreamResult
impl Hash for StreamableContent
impl Hash for Stretch
impl Hash for Style
impl Hash for Style
impl Hash for Style
impl Hash for StyleContext
impl Hash for StyleContextPrintFlags
impl Hash for StyleProperties
impl Hash for StyleProvider
impl Hash for SubpixelLayout
impl Hash for Subprocess
impl Hash for SubprocessFlags
impl Hash for SubprocessLauncher
impl Hash for Switch
impl Hash for TDEFLFlush
impl Hash for TDEFLStatus
impl Hash for TINFLStatus
impl Hash for TabAlign
impl Hash for TabArray
impl Hash for Table
impl Hash for TableCell
impl Hash for Tag
impl Hash for TargetFlags
impl Hash for TargetList
impl Hash for TcpConnection
impl Hash for Text
impl Hash for TextAttribute
impl Hash for TextAttributes
impl Hash for TextBoundary
impl Hash for TextBuffer
impl Hash for TextChildAnchor
impl Hash for TextClipType
impl Hash for TextDirection
impl Hash for TextExtendSelection
impl Hash for TextGranularity
impl Hash for TextMark
impl Hash for TextPos
impl Hash for TextRange
impl Hash for TextSearchFlags
impl Hash for TextTag
impl Hash for TextTagTable
impl Hash for TextView
impl Hash for TextViewLayer
impl Hash for TextWindowType
impl Hash for ThemedIcon
impl Hash for ThreadedSocketService
impl Hash for TlsAuthenticationMode
impl Hash for TlsBackend
impl Hash for TlsCertificate
impl Hash for TlsCertificateFlags
impl Hash for TlsCertificateRequestFlags
impl Hash for TlsClientConnection
impl Hash for TlsConnection
impl Hash for TlsDatabase
impl Hash for TlsDatabaseLookupFlags
impl Hash for TlsDatabaseVerifyFlags
impl Hash for TlsError
impl Hash for TlsFileDatabase
impl Hash for TlsInteraction
impl Hash for TlsInteractionResult
impl Hash for TlsPassword
impl Hash for TlsPasswordFlags
impl Hash for TlsRehandshakeMode
impl Hash for TlsServerConnection
impl Hash for ToggleButton
impl Hash for ToggleToolButton
impl Hash for ToolButton
impl Hash for ToolItem
impl Hash for ToolItemGroup
impl Hash for ToolPalette
impl Hash for ToolPaletteDragTargets
impl Hash for ToolShell
impl Hash for Toolbar
impl Hash for ToolbarStyle
impl Hash for Tooltip
impl Hash for Transformations
impl Hash for TreeDragDest
impl Hash for TreeDragSource
impl Hash for TreeModel
impl Hash for TreeModelFilter
impl Hash for TreeModelFlags
impl Hash for TreeModelSort
impl Hash for TreePath
impl Hash for TreeRowReference
impl Hash for TreeSelection
impl Hash for TreeSortable
impl Hash for TreeStore
impl Hash for TreeView
impl Hash for TreeViewColumn
impl Hash for TreeViewColumnSizing
impl Hash for TreeViewDropPosition
impl Hash for TreeViewGridLines
impl Hash for UiKitDisplayHandle
impl Hash for UiKitWindowHandle
impl Hash for Underline
impl Hash for UnicodeVersion
impl Hash for Unit
impl Hash for UnixFDList
impl Hash for UnixInputStream
impl Hash for UnixOutputStream
impl Hash for UnixSocketAddress
impl Hash for UnixSocketAddressType
impl Hash for UnsupportedFeature
impl Hash for Util
impl Hash for Value
impl Hash for ValueType
impl Hash for Variant
impl Hash for Variant
impl Hash for Version
impl Hash for Vfs
impl Hash for Viewport
impl Hash for VisibilityState
impl Hash for Visual
impl Hash for VisualType
impl Hash for Volume
impl Hash for VolumeButton
impl Hash for VolumeMonitor
impl Hash for WMDecoration
impl Hash for WMFunction
impl Hash for WaylandDisplayHandle
impl Hash for WaylandWindowHandle
impl Hash for WebDisplayHandle
impl Hash for WebWindowHandle
impl Hash for Weight
impl Hash for Weight
impl Hash for Weight
impl Hash for Widget
impl Hash for WidgetHelpType
impl Hash for WidgetPath
impl Hash for Width
impl Hash for Win32WindowHandle
impl Hash for WinRtWindowHandle
impl Hash for Window
impl Hash for Window
impl Hash for Window
impl Hash for WindowEdge
impl Hash for WindowGroup
impl Hash for WindowHints
impl Hash for WindowPosition
impl Hash for WindowState
impl Hash for WindowType
impl Hash for WindowType
impl Hash for WindowTypeHint
impl Hash for WindowWindowClass
impl Hash for WindowsDisplayHandle
impl Hash for WrapMode
impl Hash for WrapMode
impl Hash for WriteOutputStream
impl Hash for XcbDisplayHandle
impl Hash for XcbWindowHandle
impl Hash for XlibDisplayHandle
impl Hash for XlibWindowHandle
impl Hash for ZlibCompressor
impl Hash for ZlibCompressorFormat
impl Hash for ZlibDecompressor
impl Hash for __c_anonymous_ifru_map
impl Hash for __c_anonymous_ptrace_syscall_info_data
impl Hash for __c_anonymous_ptrace_syscall_info_entry
impl Hash for __c_anonymous_ptrace_syscall_info_exit
impl Hash for __c_anonymous_ptrace_syscall_info_seccomp
impl Hash for __c_anonymous_sockaddr_can_j1939
impl Hash for __c_anonymous_sockaddr_can_tp
impl Hash for __exit_status
impl Hash for __timeval
impl Hash for _libc_fpstate
impl Hash for _libc_fpxreg
impl Hash for _libc_xmmreg
impl Hash for addrinfo
impl Hash for af_alg_iv
impl Hash for aiocb
impl Hash for arpd_request
impl Hash for arphdr
impl Hash for arpreq
impl Hash for arpreq_old
impl Hash for can_filter
impl Hash for clone_args
impl Hash for cmsghdr
impl Hash for cpu_set_t
impl Hash for dirent
impl Hash for dirent64
impl Hash for dl_phdr_info
impl Hash for dqblk
impl Hash for epoll_event
impl Hash for fanotify_event_metadata
impl Hash for fanotify_response
impl Hash for fd_set
impl Hash for ff_condition_effect
impl Hash for ff_constant_effect
impl Hash for ff_effect
impl Hash for ff_envelope
impl Hash for ff_periodic_effect
impl Hash for ff_ramp_effect
impl Hash for ff_replay
impl Hash for ff_rumble_effect
impl Hash for ff_trigger
impl Hash for file_clone_range
impl Hash for flock
impl Hash for flock64
impl Hash for fsid_t
impl Hash for genlmsghdr
impl Hash for glob64_t
impl Hash for glob_t
impl Hash for group
impl Hash for hostent
impl Hash for if_nameindex
impl Hash for ifaddrs
impl Hash for in6_addr
impl Hash for in6_ifreq
impl Hash for in6_pktinfo
impl Hash for in6_rtmsg
impl Hash for in_addr
impl Hash for in_pktinfo
impl Hash for inotify_event
impl Hash for input_absinfo
impl Hash for input_event
impl Hash for input_id
impl Hash for input_keymap_entry
impl Hash for input_mask
impl Hash for iovec
impl Hash for ip_mreq
impl Hash for ip_mreq_source
impl Hash for ip_mreqn
impl Hash for ipc_perm
impl Hash for ipv6_mreq
impl Hash for itimerspec
impl Hash for itimerval
impl Hash for j1939_filter
impl Hash for lconv
impl Hash for linger
impl Hash for mallinfo
impl Hash for mallinfo2
impl Hash for mcontext_t
impl Hash for mmsghdr
impl Hash for mntent
impl Hash for mq_attr
impl Hash for msghdr
impl Hash for msginfo
impl Hash for msqid_ds
impl Hash for nl_mmap_hdr
impl Hash for nl_mmap_req
impl Hash for nl_pktinfo
impl Hash for nlattr
impl Hash for nlmsgerr
impl Hash for nlmsghdr
impl Hash for ntptimeval
impl Hash for open_how
impl Hash for option
impl Hash for packet_mreq
impl Hash for pollfd
impl Hash for posix_spawn_file_actions_t
impl Hash for posix_spawnattr_t
impl Hash for protoent
impl Hash for pthread_attr_t
impl Hash for pthread_cond_t
impl Hash for pthread_condattr_t
impl Hash for pthread_mutex_t
impl Hash for pthread_mutexattr_t
impl Hash for pthread_rwlock_t
impl Hash for pthread_rwlockattr_t
impl Hash for ptrace_peeksiginfo_args
impl Hash for ptrace_rseq_configuration
impl Hash for ptrace_syscall_info
impl Hash for regex_t
impl Hash for regmatch_t
impl Hash for rlimit
impl Hash for rlimit64
impl Hash for rtentry
impl Hash for rusage
impl Hash for sched_param
impl Hash for seccomp_data
impl Hash for seccomp_notif_sizes
impl Hash for sem_t
impl Hash for sembuf
impl Hash for semid_ds
impl Hash for seminfo
impl Hash for servent
impl Hash for shmid_ds
impl Hash for sigaction
impl Hash for sigevent
impl Hash for siginfo_t
impl Hash for signalfd_siginfo
impl Hash for sigset_t
impl Hash for sigval
impl Hash for sock_extended_err
impl Hash for sock_filter
impl Hash for sock_fprog
impl Hash for sockaddr
impl Hash for sockaddr_alg
impl Hash for sockaddr_in
impl Hash for sockaddr_in6
impl Hash for sockaddr_ll
impl Hash for sockaddr_nl
impl Hash for sockaddr_storage
impl Hash for sockaddr_un
impl Hash for sockaddr_vm
impl Hash for spwd
impl Hash for stack_t
impl Hash for stat
impl Hash for stat64
impl Hash for statfs
impl Hash for statfs64
impl Hash for statvfs
impl Hash for statvfs64
impl Hash for statx
impl Hash for statx_timestamp
impl Hash for sysinfo
impl Hash for termios
impl Hash for termios2
impl Hash for timespec
impl Hash for timeval
impl Hash for timex
impl Hash for tm
impl Hash for tms
impl Hash for ucontext_t
impl Hash for ucred
impl Hash for uinput_abs_setup
impl Hash for uinput_ff_erase
impl Hash for uinput_ff_upload
impl Hash for uinput_setup
impl Hash for uinput_user_dev
impl Hash for user
impl Hash for user_fpregs_struct
impl Hash for user_regs_struct
impl Hash for utimbuf
impl Hash for utmpx
impl Hash for utsname
impl Hash for winsize
impl<'a> Hash for std::path::Component<'a>
impl<'a> Hash for Prefix<'a>
impl<'a> Hash for druid::piet::cairo::glib::bitflags::_core::panic::Location<'a>
impl<'a> Hash for Metadata<'a>
impl<'a> Hash for MetadataBuilder<'a>
impl<'a> Hash for ElementEnd<'a>
impl<'a> Hash for EntityDefinition<'a>
impl<'a> Hash for ExternalId<'a>
impl<'a> Hash for Family<'a>
impl<'a> Hash for Query<'a>
impl<'a> Hash for Reference<'a>
impl<'a> Hash for StrSpan<'a>
impl<'a> Hash for Stream<'a>
impl<'a> Hash for Token<'a>
impl<'a, T> Hash for BorrowedObject<'a, T>where T: Hash,
impl<'list> Hash for AttrIterator<'list>
impl<'text> Hash for BidiInfo<'text>
impl<'text> Hash for ScriptIter<'text>
impl<A> Hash for OrdSet<A>where A: Ord + Hash,
impl<A> Hash for Vector<A>where A: Clone + Hash,
impl<A> Hash for SmallVec<A>where A: Array, <A as Array>::Item: Hash,
impl<A, N> Hash for Chunk<A, N>where A: Hash, N: ChunkLength<A>,
impl<A, S> Hash for HashSet<A, S>where A: Hash + Eq, S: BuildHasher + Default,
impl<A, T> Hash for FixedSizeVariantArray<A, T>where A: Hash + AsRef<[T]>, T: Hash + FixedSizeVariantType,
impl<A, T> Hash for InlineArray<A, T>where A: Hash,
impl<B> Hash for Cow<'_, B>where B: Hash + ToOwned + ?Sized,
impl<B, C> Hash for ControlFlow<B, C>where B: Hash, C: Hash,
impl<ComponentType> Hash for BGR<ComponentType>where ComponentType: Hash,
impl<ComponentType> Hash for Gray<ComponentType>where ComponentType: Hash,
impl<ComponentType> Hash for RGB<ComponentType>where ComponentType: Hash,
impl<ComponentType, AlphaComponentType> Hash for BGRA<ComponentType, AlphaComponentType>where ComponentType: Hash, AlphaComponentType: Hash,
impl<ComponentType, AlphaComponentType> Hash for GrayAlpha<ComponentType, AlphaComponentType>where ComponentType: Hash, AlphaComponentType: Hash,
impl<ComponentType, AlphaComponentType> Hash for RGBA<ComponentType, AlphaComponentType>where ComponentType: Hash, AlphaComponentType: Hash,
impl<Dyn> Hash for DynMetadata<Dyn>where Dyn: ?Sized,
impl<Idx> Hash for druid::piet::cairo::glib::bitflags::_core::ops::Range<Idx>where Idx: Hash,
impl<Idx> Hash for RangeFrom<Idx>where Idx: Hash,
impl<Idx> Hash for RangeInclusive<Idx>where Idx: Hash,
impl<Idx> Hash for RangeTo<Idx>where Idx: Hash,
impl<Idx> Hash for RangeToInclusive<Idx>where Idx: Hash,
impl<K, V> Hash for OrdMap<K, V>where K: Ord + Hash, V: Hash,
impl<K, V, A> Hash for BTreeMap<K, V, A>where K: Hash, V: Hash, A: Allocator + Clone,
impl<K, V, S> Hash for HashMap<K, V, S>where K: Hash + Eq, V: Hash, S: BuildHasher,
impl<P> Hash for Pin<P>where P: Deref, <P as Deref>::Target: Hash,
impl<P, Container> Hash for ImageBuffer<P, Container>where P: Hash + Pixel, Container: Hash,
impl<Ret, T> Hash for fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
impl<Ret, T> Hash for extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
impl<Ret, T> Hash for extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
impl<Ret, T> Hash for extern "C-unwind" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
impl<Ret, T> Hash for extern "C-unwind" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
impl<Ret, T> Hash for unsafe fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
impl<Ret, T> Hash for unsafe extern "C" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
impl<Ret, T> Hash for unsafe extern "C" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
impl<Ret, T> Hash for unsafe extern "C-unwind" fn (T₁, T₂, …, Tₙ) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
impl<Ret, T> Hash for unsafe extern "C-unwind" fn (T₁, T₂, …, Tₙ, ...) -> Ret
This trait is implemented for function pointers with up to twelve arguments.
impl<T> Hash for Bound<T>where T: Hash,
impl<T> Hash for Option<T>where T: Hash,
impl<T> Hash for Poll<T>where T: Hash,
impl<T> Hash for *const Twhere T: ?Sized,
impl<T> Hash for *mut Twhere T: ?Sized,
impl<T> Hash for &Twhere T: Hash + ?Sized,
impl<T> Hash for &mut Twhere T: Hash + ?Sized,
impl<T> Hash for [T]where T: Hash,
impl<T> Hash for (T₁, T₂, …, Tₙ)where T: Hash + ?Sized,
This trait is implemented for tuples up to twelve items long.
impl<T> Hash for Luma<T>where T: Hash,
impl<T> Hash for LumaA<T>where T: Hash,
impl<T> Hash for Rgb<T>where T: Hash,
impl<T> Hash for Rgba<T>where T: Hash,
impl<T> Hash for PtrSlice<T>where T: Hash + GlibPtrDefault + FromGlibPtrFull<<T as GlibPtrDefault>::GlibType> + FromGlibPtrNone<<T as GlibPtrDefault>::GlibType>,
impl<T> Hash for Slice<T>where T: Hash + 'static,
impl<T> Hash for ObjectImplRef<T>where T: ObjectSubclass,
impl<T> Hash for Reverse<T>where T: Hash,
impl<T> Hash for PhantomData<T>where T: ?Sized,
impl<T> Hash for Discriminant<T>
impl<T> Hash for ManuallyDrop<T>where T: Hash + ?Sized,
impl<T> Hash for Saturating<T>where T: Hash,
impl<T> Hash for Wrapping<T>where T: Hash,
impl<T> Hash for NonNull<T>where T: ?Sized,
impl<T> Hash for LinkedList<T>where T: Hash,
impl<T> Hash for Rc<T>where T: Hash + ?Sized,
impl<T> Hash for Arc<T>where T: Hash + ?Sized,
impl<T> Hash for Ratio<T>where T: Clone + Integer + Hash,
impl<T, A> Hash for alloc::boxed::Box<T, A>where T: Hash + ?Sized, A: Allocator,
impl<T, A> Hash for BTreeSet<T, A>where T: Hash, A: Allocator + Clone,
impl<T, A> Hash for VecDeque<T, A>where T: Hash, A: Allocator,
impl<T, A> Hash for Vec<T, A>where T: Hash, A: Allocator,
The hash of a vector is the same as that of the corresponding slice,
as required by the core::borrow::Borrow
implementation.
#![feature(build_hasher_simple_hash_one)]
use std::hash::BuildHasher;
let b = std::collections::hash_map::RandomState::new();
let v: Vec<u8> = vec![0xa8, 0x3c, 0x09];
let s: &[u8] = &[0xa8, 0x3c, 0x09];
assert_eq!(b.hash_one(v), b.hash_one(s));
impl<T, E> Hash for Result<T, E>where T: Hash, E: Hash,
impl<T, MM> Hash for Boxed<T, MM>where MM: BoxedMemoryManager<T>,
impl<T, P> Hash for TypedObjectRef<T, P>
impl<T, const CAP: usize> Hash for ArrayVec<T, CAP>where T: Hash,
impl<T, const LANES: usize> Hash for Simd<T, LANES>where LaneCount<LANES>: SupportedLaneCount, T: SimdElement + Hash,
impl<T, const N: usize> Hash for [T; N]where T: Hash,
The hash of an array is the same as that of the corresponding slice,
as required by the Borrow
implementation.
#![feature(build_hasher_simple_hash_one)]
use std::hash::BuildHasher;
let b = std::collections::hash_map::RandomState::new();
let a: [u8; 3] = [0xa8, 0x3c, 0x09];
let s: &[u8] = &[0xa8, 0x3c, 0x09];
assert_eq!(b.hash_one(a), b.hash_one(s));