Path: blob/main/crates/bevy_reflect/src/impls/std/collections/hash_map.rs
6601 views
use bevy_reflect_derive::impl_type_path;12use crate::impls::macros::impl_reflect_for_hashmap;3#[cfg(feature = "functions")]4use crate::{5from_reflect::FromReflect, type_info::MaybeTyped, type_path::TypePath,6type_registry::GetTypeRegistration,7};8#[cfg(feature = "functions")]9use core::hash::{BuildHasher, Hash};1011impl_reflect_for_hashmap!(::std::collections::HashMap<K, V, S>);12impl_type_path!(::std::collections::hash_map::RandomState);13impl_type_path!(::std::collections::HashMap<K, V, S>);1415#[cfg(feature = "functions")]16crate::func::macros::impl_function_traits!(::std::collections::HashMap<K, V, S>;17<18K: FromReflect + MaybeTyped + TypePath + GetTypeRegistration + Eq + Hash,19V: FromReflect + MaybeTyped + TypePath + GetTypeRegistration,20S: TypePath + BuildHasher + Default + Send + Sync21>22);2324#[cfg(test)]25mod tests {26use crate::Reflect;27use static_assertions::assert_impl_all;2829#[test]30fn should_reflect_hashmaps() {31assert_impl_all!(std::collections::HashMap<u32, f32>: Reflect);32}33}343536