pub struct EntityEquivalentHashSet<K: EntityEquivalent + Hash>(/* private fields */);Expand description
A HashSet pre-configured to use EntityHash hashing.
Implementations§
Source§impl<K: EntityEquivalent + Hash> EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash> EntityEquivalentHashSet<K>
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Creates an empty EntityEquivalentHashSet.
Equivalent to HashSet::with_hasher(EntityHash).
Sourcepub fn with_capacity(n: usize) -> Self
pub fn with_capacity(n: usize) -> Self
Creates an empty EntityEquivalentHashSet with the specified capacity.
Equivalent to HashSet::with_capacity_and_hasher(n, EntityHash).
Sourcepub const fn from_hash_set(set: HashSet<K, EntityHash>) -> Self
pub const fn from_hash_set(set: HashSet<K, EntityHash>) -> Self
Constructs an EntityHashSet from an HashSet.
Sourcepub fn into_inner(self) -> HashSet<K, EntityHash>
pub fn into_inner(self) -> HashSet<K, EntityHash>
Returns the inner HashSet.
Sourcepub fn drain(&mut self) -> Drain<'_, K> ⓘ
pub fn drain(&mut self) -> Drain<'_, K> ⓘ
Clears the set, returning all elements in an iterator.
Equivalent to HashSet::drain.
Sourcepub fn iter(&self) -> Iter<'_, K> ⓘ
pub fn iter(&self) -> Iter<'_, K> ⓘ
An iterator visiting all elements in arbitrary order.
The iterator element type is &'a Entity.
Equivalent to HashSet::iter.
Sourcepub fn extract_if<F: FnMut(&K) -> bool>(&mut self, f: F) -> ExtractIf<'_, K, F> ⓘ
pub fn extract_if<F: FnMut(&K) -> bool>(&mut self, f: F) -> ExtractIf<'_, K, F> ⓘ
Drains elements which are true under the given predicate, and returns an iterator over the removed items.
Equivalent to HashSet::extract_if.
Methods from Deref<Target = HashSet<K, EntityHash>>§
Sourcepub fn iter(&self) -> Iter<'_, T> ⓘ
pub fn iter(&self) -> Iter<'_, T> ⓘ
An iterator visiting all elements in arbitrary order.
The iterator element type is &'a T.
Refer to iter for further details.
§Examples
let mut map = HashSet::new();
map.insert("foo");
map.insert("bar");
map.insert("baz");
for value in map.iter() {
// "foo", "bar", "baz"
// Note that the above order is not guaranteed
}Sourcepub fn drain(&mut self) -> Drain<'_, T> ⓘ
pub fn drain(&mut self) -> Drain<'_, T> ⓘ
Clears the set, returning all elements in an iterator.
Refer to drain for further details.
§Examples
let mut map = HashSet::new();
map.insert("foo");
map.insert("bar");
map.insert("baz");
for value in map.drain() {
// "foo", "bar", "baz"
// Note that the above order is not guaranteed
}
assert!(map.is_empty());Sourcepub fn extract_if<F>(&mut self, f: F) -> ExtractIf<'_, T, F> ⓘ
pub fn extract_if<F>(&mut self, f: F) -> ExtractIf<'_, T, F> ⓘ
Drains elements which are true under the given predicate, and returns an iterator over the removed items.
Refer to extract_if for further details.
§Examples
let mut map = HashSet::new();
map.insert("foo");
map.insert("bar");
map.insert("baz");
let extracted = map
.extract_if(|value| *value == "baz")
.collect::<Vec<_>>();
assert_eq!(map.len(), 2);
assert_eq!(extracted.len(), 1);Sourcepub fn hasher(&self) -> &S
pub fn hasher(&self) -> &S
Returns a reference to the set’s BuildHasher.
Refer to hasher for further details.
Sourcepub fn reserve(&mut self, additional: usize)
pub fn reserve(&mut self, additional: usize)
Reserves capacity for at least additional more elements to be inserted
in the HashSet. The collection may reserve more space to avoid
frequent reallocations.
Refer to reserve for further details.
§Examples
let mut map = HashSet::with_capacity(5);
assert!(map.capacity() >= 5);
map.reserve(10);
assert!(map.capacity() - map.len() >= 10);Sourcepub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError>
Tries to reserve capacity for at least additional more elements to be inserted
in the given HashSet<K,V>. The collection may reserve more space to avoid
frequent reallocations.
Refer to try_reserve for further details.
§Examples
let mut map = HashSet::with_capacity(5);
assert!(map.capacity() >= 5);
map.try_reserve(10).expect("Out of Memory!");
assert!(map.capacity() - map.len() >= 10);Sourcepub fn shrink_to_fit(&mut self)
pub fn shrink_to_fit(&mut self)
Shrinks the capacity of the set as much as possible. It will drop down as much as possible while maintaining the internal rules and possibly leaving some space in accordance with the resize policy.
Refer to shrink_to_fit for further details.
§Examples
let mut map = HashSet::with_capacity(5);
map.insert("foo");
map.insert("bar");
map.insert("baz");
assert!(map.capacity() >= 5);
map.shrink_to_fit();
assert_eq!(map.capacity(), 3);Sourcepub fn shrink_to(&mut self, min_capacity: usize)
pub fn shrink_to(&mut self, min_capacity: usize)
Shrinks the capacity of the set with a lower limit. It will drop down no lower than the supplied limit while maintaining the internal rules and possibly leaving some space in accordance with the resize policy.
Refer to shrink_to for further details.
Sourcepub fn difference<'a>(
&'a self,
other: &'a HashSet<T, S>,
) -> Difference<'a, T, S> ⓘ
pub fn difference<'a>( &'a self, other: &'a HashSet<T, S>, ) -> Difference<'a, T, S> ⓘ
Visits the values representing the difference,
i.e., the values that are in self but not in other.
Refer to difference for further details.
Sourcepub fn symmetric_difference<'a>(
&'a self,
other: &'a HashSet<T, S>,
) -> SymmetricDifference<'a, T, S> ⓘ
pub fn symmetric_difference<'a>( &'a self, other: &'a HashSet<T, S>, ) -> SymmetricDifference<'a, T, S> ⓘ
Visits the values representing the symmetric difference,
i.e., the values that are in self or in other but not in both.
Refer to symmetric_difference for further details.
Sourcepub fn intersection<'a>(
&'a self,
other: &'a HashSet<T, S>,
) -> Intersection<'a, T, S> ⓘ
pub fn intersection<'a>( &'a self, other: &'a HashSet<T, S>, ) -> Intersection<'a, T, S> ⓘ
Visits the values representing the intersection,
i.e., the values that are both in self and other.
Refer to intersection for further details.
Sourcepub fn union<'a>(&'a self, other: &'a HashSet<T, S>) -> Union<'a, T, S> ⓘ
pub fn union<'a>(&'a self, other: &'a HashSet<T, S>) -> Union<'a, T, S> ⓘ
Visits the values representing the union,
i.e., all the values in self or other, without duplicates.
Refer to union for further details.
Sourcepub fn get_or_insert(&mut self, value: T) -> &T
pub fn get_or_insert(&mut self, value: T) -> &T
Inserts the given value into the set if it is not present, then
returns a reference to the value in the set.
Refer to get_or_insert for further details.
§Examples
let mut map = HashSet::new();
assert_eq!(map.get_or_insert("foo"), &"foo");Sourcepub fn get_or_insert_with<Q, F>(&mut self, value: &Q, f: F) -> &T
pub fn get_or_insert_with<Q, F>(&mut self, value: &Q, f: F) -> &T
Inserts a value computed from f into the set if the given value is
not present, then returns a reference to the value in the set.
Refer to get_or_insert_with for further details.
§Examples
let mut map = HashSet::new();
assert_eq!(map.get_or_insert_with(&"foo", |_| "foo"), &"foo");Sourcepub fn is_disjoint(&self, other: &HashSet<T, S>) -> bool
pub fn is_disjoint(&self, other: &HashSet<T, S>) -> bool
Returns true if self has no elements in common with other.
This is equivalent to checking for an empty intersection.
Refer to is_disjoint for further details.
Sourcepub fn is_subset(&self, other: &HashSet<T, S>) -> bool
pub fn is_subset(&self, other: &HashSet<T, S>) -> bool
Returns true if the set is a subset of another,
i.e., other contains at least all the values in self.
Refer to is_subset for further details.
Sourcepub fn is_superset(&self, other: &HashSet<T, S>) -> bool
pub fn is_superset(&self, other: &HashSet<T, S>) -> bool
Returns true if the set is a superset of another,
i.e., self contains at least all the values in other.
Refer to is_superset for further details.
Sourcepub fn allocation_size(&self) -> usize
pub fn allocation_size(&self) -> usize
Returns the total amount of memory allocated internally by the hash set, in bytes.
Refer to allocation_size for further details.
§Examples
let mut map = HashSet::new();
assert_eq!(map.allocation_size(), 0);
map.insert("foo");
assert!(map.allocation_size() >= size_of::<&'static str>());Sourcepub unsafe fn insert_unique_unchecked(&mut self, value: T) -> &T
pub unsafe fn insert_unique_unchecked(&mut self, value: T) -> &T
Insert a value the set without checking if the value already exists in the set.
Refer to insert_unique_unchecked for further details.
§Safety
This operation is safe if a value does not exist in the set.
However, if a value exists in the set already, the behavior is unspecified: this operation may panic, loop forever, or any following operation with the set may panic, loop forever or return arbitrary result.
That said, this operation (and following operations) are guaranteed to not violate memory safety.
However this operation is still unsafe because the resulting HashSet
may be passed to unsafe code which does expect the set to behave
correctly, and would cause unsoundness as a result.
Methods from Deref<Target = HashSet<T, S>>§
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of elements the set can hold without reallocating.
§Examples
use hashbrown::HashSet;
let set: HashSet<i32> = HashSet::with_capacity(100);
assert!(set.capacity() >= 100);Sourcepub fn iter(&self) -> Iter<'_, T> ⓘ
pub fn iter(&self) -> Iter<'_, T> ⓘ
An iterator visiting all elements in arbitrary order.
The iterator element type is &'a T.
§Examples
use hashbrown::HashSet;
let mut set = HashSet::new();
set.insert("a");
set.insert("b");
// Will print in an arbitrary order.
for x in set.iter() {
println!("{}", x);
}Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Returns the number of elements in the set.
§Examples
use hashbrown::HashSet;
let mut v = HashSet::new();
assert_eq!(v.len(), 0);
v.insert(1);
assert_eq!(v.len(), 1);Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if the set contains no elements.
§Examples
use hashbrown::HashSet;
let mut v = HashSet::new();
assert!(v.is_empty());
v.insert(1);
assert!(!v.is_empty());Sourcepub fn hasher(&self) -> &S
pub fn hasher(&self) -> &S
Returns a reference to the set’s BuildHasher.
§Examples
use hashbrown::HashSet;
use hashbrown::DefaultHashBuilder;
let hasher = DefaultHashBuilder::default();
let set: HashSet<i32> = HashSet::with_hasher(hasher);
let hasher: &DefaultHashBuilder = set.hasher();Sourcepub fn difference<'a>(
&'a self,
other: &'a HashSet<T, S, A>,
) -> Difference<'a, T, S, A> ⓘ
pub fn difference<'a>( &'a self, other: &'a HashSet<T, S, A>, ) -> Difference<'a, T, S, A> ⓘ
Visits the values representing the difference,
i.e., the values that are in self but not in other.
§Examples
use hashbrown::HashSet;
let a: HashSet<_> = [1, 2, 3].into_iter().collect();
let b: HashSet<_> = [4, 2, 3, 4].into_iter().collect();
// Can be seen as `a - b`.
for x in a.difference(&b) {
println!("{}", x); // Print 1
}
let diff: HashSet<_> = a.difference(&b).collect();
assert_eq!(diff, [1].iter().collect());
// Note that difference is not symmetric,
// and `b - a` means something else:
let diff: HashSet<_> = b.difference(&a).collect();
assert_eq!(diff, [4].iter().collect());Sourcepub fn symmetric_difference<'a>(
&'a self,
other: &'a HashSet<T, S, A>,
) -> SymmetricDifference<'a, T, S, A> ⓘ
pub fn symmetric_difference<'a>( &'a self, other: &'a HashSet<T, S, A>, ) -> SymmetricDifference<'a, T, S, A> ⓘ
Visits the values representing the symmetric difference,
i.e., the values that are in self or in other but not in both.
§Examples
use hashbrown::HashSet;
let a: HashSet<_> = [1, 2, 3].into_iter().collect();
let b: HashSet<_> = [4, 2, 3, 4].into_iter().collect();
// Print 1, 4 in arbitrary order.
for x in a.symmetric_difference(&b) {
println!("{}", x);
}
let diff1: HashSet<_> = a.symmetric_difference(&b).collect();
let diff2: HashSet<_> = b.symmetric_difference(&a).collect();
assert_eq!(diff1, diff2);
assert_eq!(diff1, [1, 4].iter().collect());Sourcepub fn intersection<'a>(
&'a self,
other: &'a HashSet<T, S, A>,
) -> Intersection<'a, T, S, A> ⓘ
pub fn intersection<'a>( &'a self, other: &'a HashSet<T, S, A>, ) -> Intersection<'a, T, S, A> ⓘ
Visits the values representing the intersection,
i.e., the values that are both in self and other.
§Examples
use hashbrown::HashSet;
let a: HashSet<_> = [1, 2, 3].into_iter().collect();
let b: HashSet<_> = [4, 2, 3, 4].into_iter().collect();
// Print 2, 3 in arbitrary order.
for x in a.intersection(&b) {
println!("{}", x);
}
let intersection: HashSet<_> = a.intersection(&b).collect();
assert_eq!(intersection, [2, 3].iter().collect());Sourcepub fn union<'a>(&'a self, other: &'a HashSet<T, S, A>) -> Union<'a, T, S, A> ⓘ
pub fn union<'a>(&'a self, other: &'a HashSet<T, S, A>) -> Union<'a, T, S, A> ⓘ
Visits the values representing the union,
i.e., all the values in self or other, without duplicates.
§Examples
use hashbrown::HashSet;
let a: HashSet<_> = [1, 2, 3].into_iter().collect();
let b: HashSet<_> = [4, 2, 3, 4].into_iter().collect();
// Print 1, 2, 3, 4 in arbitrary order.
for x in a.union(&b) {
println!("{}", x);
}
let union: HashSet<_> = a.union(&b).collect();
assert_eq!(union, [1, 2, 3, 4].iter().collect());Sourcepub fn contains<Q>(&self, value: &Q) -> bool
pub fn contains<Q>(&self, value: &Q) -> bool
Returns true if the set contains a value.
The value may be any borrowed form of the set’s value type, but
Hash and Eq on the borrowed form must match those for
the value type.
§Examples
use hashbrown::HashSet;
let set: HashSet<_> = [1, 2, 3].into_iter().collect();
assert_eq!(set.contains(&1), true);
assert_eq!(set.contains(&4), false);Sourcepub fn get<Q>(&self, value: &Q) -> Option<&T>
pub fn get<Q>(&self, value: &Q) -> Option<&T>
Returns a reference to the value in the set, if any, that is equal to the given value.
The value may be any borrowed form of the set’s value type, but
Hash and Eq on the borrowed form must match those for
the value type.
§Examples
use hashbrown::HashSet;
let set: HashSet<_> = [1, 2, 3].into_iter().collect();
assert_eq!(set.get(&2), Some(&2));
assert_eq!(set.get(&4), None);Sourcepub fn is_disjoint(&self, other: &HashSet<T, S, A>) -> bool
pub fn is_disjoint(&self, other: &HashSet<T, S, A>) -> bool
Returns true if self has no elements in common with other.
This is equivalent to checking for an empty intersection.
§Examples
use hashbrown::HashSet;
let a: HashSet<_> = [1, 2, 3].into_iter().collect();
let mut b = HashSet::new();
assert_eq!(a.is_disjoint(&b), true);
b.insert(4);
assert_eq!(a.is_disjoint(&b), true);
b.insert(1);
assert_eq!(a.is_disjoint(&b), false);Sourcepub fn is_subset(&self, other: &HashSet<T, S, A>) -> bool
pub fn is_subset(&self, other: &HashSet<T, S, A>) -> bool
Returns true if the set is a subset of another,
i.e., other contains at least all the values in self.
§Examples
use hashbrown::HashSet;
let sup: HashSet<_> = [1, 2, 3].into_iter().collect();
let mut set = HashSet::new();
assert_eq!(set.is_subset(&sup), true);
set.insert(2);
assert_eq!(set.is_subset(&sup), true);
set.insert(4);
assert_eq!(set.is_subset(&sup), false);Sourcepub fn is_superset(&self, other: &HashSet<T, S, A>) -> bool
pub fn is_superset(&self, other: &HashSet<T, S, A>) -> bool
Returns true if the set is a superset of another,
i.e., self contains at least all the values in other.
§Examples
use hashbrown::HashSet;
let sub: HashSet<_> = [1, 2].into_iter().collect();
let mut set = HashSet::new();
assert_eq!(set.is_superset(&sub), false);
set.insert(0);
set.insert(1);
assert_eq!(set.is_superset(&sub), false);
set.insert(2);
assert_eq!(set.is_superset(&sub), true);Sourcepub fn allocation_size(&self) -> usize
pub fn allocation_size(&self) -> usize
Returns the total amount of memory allocated internally by the hash set, in bytes.
The returned number is informational only. It is intended to be primarily used for memory profiling.
Trait Implementations§
Source§impl<K: EntityEquivalent + Hash + Clone> BitAnd for &EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash + Clone> BitAnd for &EntityEquivalentHashSet<K>
Source§impl<K: EntityEquivalent + Hash + Clone> BitAndAssign<&EntityEquivalentHashSet<K>> for EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash + Clone> BitAndAssign<&EntityEquivalentHashSet<K>> for EntityEquivalentHashSet<K>
Source§fn bitand_assign(&mut self, rhs: &Self)
fn bitand_assign(&mut self, rhs: &Self)
&= operation. Read moreSource§impl<K: EntityEquivalent + Hash + Clone> BitOr for &EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash + Clone> BitOr for &EntityEquivalentHashSet<K>
Source§impl<K: EntityEquivalent + Hash + Clone> BitOrAssign<&EntityEquivalentHashSet<K>> for EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash + Clone> BitOrAssign<&EntityEquivalentHashSet<K>> for EntityEquivalentHashSet<K>
Source§fn bitor_assign(&mut self, rhs: &Self)
fn bitor_assign(&mut self, rhs: &Self)
|= operation. Read moreSource§impl<K: EntityEquivalent + Hash + Clone> BitXor for &EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash + Clone> BitXor for &EntityEquivalentHashSet<K>
Source§impl<K: EntityEquivalent + Hash + Clone> BitXorAssign<&EntityEquivalentHashSet<K>> for EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash + Clone> BitXorAssign<&EntityEquivalentHashSet<K>> for EntityEquivalentHashSet<K>
Source§fn bitxor_assign(&mut self, rhs: &Self)
fn bitxor_assign(&mut self, rhs: &Self)
^= operation. Read moreSource§impl<K: Clone + EntityEquivalent + Hash> Clone for EntityEquivalentHashSet<K>
impl<K: Clone + EntityEquivalent + Hash> Clone for EntityEquivalentHashSet<K>
Source§fn clone(&self) -> EntityEquivalentHashSet<K>
fn clone(&self) -> EntityEquivalentHashSet<K>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<K: Debug + EntityEquivalent + Hash> Debug for EntityEquivalentHashSet<K>
impl<K: Debug + EntityEquivalent + Hash> Debug for EntityEquivalentHashSet<K>
Source§impl<K: EntityEquivalent + Hash> Default for EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash> Default for EntityEquivalentHashSet<K>
Source§impl<K: EntityEquivalent + Hash> Deref for EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash> Deref for EntityEquivalentHashSet<K>
Source§impl<K: EntityEquivalent + Hash> DerefMut for EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash> DerefMut for EntityEquivalentHashSet<K>
impl<K: Eq + EntityEquivalent + Hash> Eq for EntityEquivalentHashSet<K>
Source§impl<'a, K: EntityEquivalent + Hash + Copy> Extend<&'a K> for EntityEquivalentHashSet<K>
impl<'a, K: EntityEquivalent + Hash + Copy> Extend<&'a K> for EntityEquivalentHashSet<K>
Source§fn extend<I: IntoIterator<Item = &'a K>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = &'a K>>(&mut self, iter: I)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl<K: EntityEquivalent + Hash> Extend<K> for EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash> Extend<K> for EntityEquivalentHashSet<K>
Source§fn extend<I: IntoIterator<Item = K>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = K>>(&mut self, iter: I)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl<K: EntityEquivalent + Hash> From<HashSet<K, EntityHash>> for EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash> From<HashSet<K, EntityHash>> for EntityEquivalentHashSet<K>
Source§fn from(value: HashSet<K, EntityHash>) -> Self
fn from(value: HashSet<K, EntityHash>) -> Self
Source§impl<K: EntityEquivalent + Hash, const N: usize> From<[K; N]> for EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash, const N: usize> From<[K; N]> for EntityEquivalentHashSet<K>
Source§impl<K: EntityEquivalent + Hash> FromEntitySetIterator<K> for EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash> FromEntitySetIterator<K> for EntityEquivalentHashSet<K>
Source§fn from_entity_set_iter<I: EntitySet<Item = K>>(set_iter: I) -> Self
fn from_entity_set_iter<I: EntitySet<Item = K>>(set_iter: I) -> Self
EntitySetIterator.Source§impl<K: EntityEquivalent + Hash> FromIterator<K> for EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash> FromIterator<K> for EntityEquivalentHashSet<K>
Source§fn from_iter<I: IntoIterator<Item = K>>(iterable: I) -> Self
fn from_iter<I: IntoIterator<Item = K>>(iterable: I) -> Self
Source§impl<K> FromReflect for EntityEquivalentHashSet<K>where
EntityEquivalentHashSet<K>: Any + Send + Sync,
K: TypePath + EntityEquivalent + Hash,
HashSet<K, EntityHash>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl<K> FromReflect for EntityEquivalentHashSet<K>where
EntityEquivalentHashSet<K>: Any + Send + Sync,
K: TypePath + EntityEquivalent + Hash,
HashSet<K, EntityHash>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>
fn from_reflect(reflect: &dyn PartialReflect) -> Option<Self>
Self from a reflected value.Source§fn take_from_reflect(
reflect: Box<dyn PartialReflect>,
) -> Result<Self, Box<dyn PartialReflect>>
fn take_from_reflect( reflect: Box<dyn PartialReflect>, ) -> Result<Self, Box<dyn PartialReflect>>
Self using,
constructing the value using from_reflect if that fails. Read moreSource§impl<K> GetTypeRegistration for EntityEquivalentHashSet<K>where
EntityEquivalentHashSet<K>: Any + Send + Sync,
K: TypePath + EntityEquivalent + Hash,
HashSet<K, EntityHash>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl<K> GetTypeRegistration for EntityEquivalentHashSet<K>where
EntityEquivalentHashSet<K>: Any + Send + Sync,
K: TypePath + EntityEquivalent + Hash,
HashSet<K, EntityHash>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn get_type_registration() -> TypeRegistration
fn get_type_registration() -> TypeRegistration
TypeRegistration for this type.Source§fn register_type_dependencies(registry: &mut TypeRegistry)
fn register_type_dependencies(registry: &mut TypeRegistry)
Source§impl<'a, K: EntityEquivalent + Hash> IntoIterator for &'a EntityEquivalentHashSet<K>
impl<'a, K: EntityEquivalent + Hash> IntoIterator for &'a EntityEquivalentHashSet<K>
Source§impl<K: EntityEquivalent + Hash> IntoIterator for EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash> IntoIterator for EntityEquivalentHashSet<K>
Source§impl<K: PartialEq + EntityEquivalent + Hash> PartialEq for EntityEquivalentHashSet<K>
impl<K: PartialEq + EntityEquivalent + Hash> PartialEq for EntityEquivalentHashSet<K>
Source§impl<K> PartialReflect for EntityEquivalentHashSet<K>where
EntityEquivalentHashSet<K>: Any + Send + Sync,
K: TypePath + EntityEquivalent + Hash,
HashSet<K, EntityHash>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl<K> PartialReflect for EntityEquivalentHashSet<K>where
EntityEquivalentHashSet<K>: Any + Send + Sync,
K: TypePath + EntityEquivalent + Hash,
HashSet<K, EntityHash>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
fn get_represented_type_info(&self) -> Option<&'static TypeInfo>
Source§fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError>
fn try_apply(&mut self, value: &dyn PartialReflect) -> Result<(), ApplyError>
Source§fn reflect_kind(&self) -> ReflectKind
fn reflect_kind(&self) -> ReflectKind
Source§fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_ref(&self) -> ReflectRef<'_>
Source§fn reflect_mut(&mut self) -> ReflectMut<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Source§fn reflect_owned(self: Box<Self>) -> ReflectOwned
fn reflect_owned(self: Box<Self>) -> ReflectOwned
Source§fn try_into_reflect(
self: Box<Self>,
) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
fn try_into_reflect( self: Box<Self>, ) -> Result<Box<dyn Reflect>, Box<dyn PartialReflect>>
Source§fn try_as_reflect(&self) -> Option<&dyn Reflect>
fn try_as_reflect(&self) -> Option<&dyn Reflect>
Source§fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>
fn try_as_reflect_mut(&mut self) -> Option<&mut dyn Reflect>
Source§fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>
fn into_partial_reflect(self: Box<Self>) -> Box<dyn PartialReflect>
Source§fn as_partial_reflect(&self) -> &dyn PartialReflect
fn as_partial_reflect(&self) -> &dyn PartialReflect
Source§fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect
fn as_partial_reflect_mut(&mut self) -> &mut dyn PartialReflect
Source§fn reflect_partial_eq(&self, value: &dyn PartialReflect) -> Option<bool>
fn reflect_partial_eq(&self, value: &dyn PartialReflect) -> Option<bool>
Source§fn reflect_partial_cmp(&self, value: &dyn PartialReflect) -> Option<Ordering>
fn reflect_partial_cmp(&self, value: &dyn PartialReflect) -> Option<Ordering>
Source§fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
fn reflect_clone(&self) -> Result<Box<dyn Reflect>, ReflectCloneError>
Self using reflection. Read moreSource§fn apply(&mut self, value: &(dyn PartialReflect + 'static))
fn apply(&mut self, value: &(dyn PartialReflect + 'static))
Source§fn to_dynamic(&self) -> Result<Box<dyn PartialReflect>, ReflectCloneError>
fn to_dynamic(&self) -> Result<Box<dyn PartialReflect>, ReflectCloneError>
Source§fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
fn reflect_clone_and_take<T>(&self) -> Result<T, ReflectCloneError>
PartialReflect, combines reflect_clone and
take in a useful fashion, automatically constructing an appropriate
ReflectCloneError if the downcast fails.Source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Source§fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn debug(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§fn is_dynamic(&self) -> bool
fn is_dynamic(&self) -> bool
Source§impl<K> Reflect for EntityEquivalentHashSet<K>where
EntityEquivalentHashSet<K>: Any + Send + Sync,
K: TypePath + EntityEquivalent + Hash,
HashSet<K, EntityHash>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl<K> Reflect for EntityEquivalentHashSet<K>where
EntityEquivalentHashSet<K>: Any + Send + Sync,
K: TypePath + EntityEquivalent + Hash,
HashSet<K, EntityHash>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
&mut dyn Any. Read moreSource§fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
fn into_reflect(self: Box<Self>) -> Box<dyn Reflect>
Source§fn as_reflect(&self) -> &dyn Reflect
fn as_reflect(&self) -> &dyn Reflect
Source§fn as_reflect_mut(&mut self) -> &mut dyn Reflect
fn as_reflect_mut(&mut self) -> &mut dyn Reflect
impl<K: PartialEq + EntityEquivalent + Hash> StructuralPartialEq for EntityEquivalentHashSet<K>
Source§impl<K: EntityEquivalent + Hash + Clone> Sub for &EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash + Clone> Sub for &EntityEquivalentHashSet<K>
Source§impl<K: EntityEquivalent + Hash + Clone> SubAssign<&EntityEquivalentHashSet<K>> for EntityEquivalentHashSet<K>
impl<K: EntityEquivalent + Hash + Clone> SubAssign<&EntityEquivalentHashSet<K>> for EntityEquivalentHashSet<K>
Source§fn sub_assign(&mut self, rhs: &Self)
fn sub_assign(&mut self, rhs: &Self)
-= operation. Read moreSource§impl<K> TupleStruct for EntityEquivalentHashSet<K>where
EntityEquivalentHashSet<K>: Any + Send + Sync,
K: TypePath + EntityEquivalent + Hash,
HashSet<K, EntityHash>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl<K> TupleStruct for EntityEquivalentHashSet<K>where
EntityEquivalentHashSet<K>: Any + Send + Sync,
K: TypePath + EntityEquivalent + Hash,
HashSet<K, EntityHash>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Source§fn field(&self, index: usize) -> Option<&dyn PartialReflect>
fn field(&self, index: usize) -> Option<&dyn PartialReflect>
index as a
&dyn Reflect.Source§fn field_mut(&mut self, index: usize) -> Option<&mut dyn PartialReflect>
fn field_mut(&mut self, index: usize) -> Option<&mut dyn PartialReflect>
index
as a &mut dyn Reflect.Source§fn iter_fields(&self) -> TupleStructFieldIter<'_> ⓘ
fn iter_fields(&self) -> TupleStructFieldIter<'_> ⓘ
Source§fn to_dynamic_tuple_struct(
&self,
) -> Result<DynamicTupleStruct, ReflectCloneError>
fn to_dynamic_tuple_struct( &self, ) -> Result<DynamicTupleStruct, ReflectCloneError>
DynamicTupleStruct from this tuple struct. Read moreSource§fn get_represented_tuple_struct_info(&self) -> Option<&'static TupleStructInfo>
fn get_represented_tuple_struct_info(&self) -> Option<&'static TupleStructInfo>
None if TypeInfo is not available.Source§impl<K> TypePath for EntityEquivalentHashSet<K>
impl<K> TypePath for EntityEquivalentHashSet<K>
Source§fn type_path() -> &'static str
fn type_path() -> &'static str
Source§fn short_type_path() -> &'static str
fn short_type_path() -> &'static str
Source§fn type_ident() -> Option<&'static str>
fn type_ident() -> Option<&'static str>
Source§fn crate_name() -> Option<&'static str>
fn crate_name() -> Option<&'static str>
Source§impl<K> Typed for EntityEquivalentHashSet<K>where
EntityEquivalentHashSet<K>: Any + Send + Sync,
K: TypePath + EntityEquivalent + Hash,
HashSet<K, EntityHash>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
impl<K> Typed for EntityEquivalentHashSet<K>where
EntityEquivalentHashSet<K>: Any + Send + Sync,
K: TypePath + EntityEquivalent + Hash,
HashSet<K, EntityHash>: FromReflect + TypePath + MaybeTyped + RegisterForReflection,
Auto Trait Implementations§
impl<K> Freeze for EntityEquivalentHashSet<K>
impl<K> RefUnwindSafe for EntityEquivalentHashSet<K>where
K: RefUnwindSafe,
impl<K> Send for EntityEquivalentHashSet<K>where
K: Send,
impl<K> Sync for EntityEquivalentHashSet<K>where
K: Sync,
impl<K> Unpin for EntityEquivalentHashSet<K>where
K: Unpin,
impl<K> UnsafeUnpin for EntityEquivalentHashSet<K>
impl<K> UnwindSafe for EntityEquivalentHashSet<K>where
K: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DynamicTypePath for Twhere
T: TypePath,
impl<T> DynamicTypePath for Twhere
T: TypePath,
Source§fn reflect_type_path(&self) -> &str
fn reflect_type_path(&self) -> &str
TypePath::type_path.Source§fn reflect_short_type_path(&self) -> &str
fn reflect_short_type_path(&self) -> &str
Source§fn reflect_type_ident(&self) -> Option<&str>
fn reflect_type_ident(&self) -> Option<&str>
TypePath::type_ident.Source§fn reflect_crate_name(&self) -> Option<&str>
fn reflect_crate_name(&self) -> Option<&str>
TypePath::crate_name.Source§fn reflect_module_path(&self) -> Option<&str>
fn reflect_module_path(&self) -> Option<&str>
Source§impl<T> DynamicTyped for Twhere
T: Typed,
impl<T> DynamicTyped for Twhere
T: Typed,
Source§fn reflect_type_info(&self) -> &'static TypeInfo
fn reflect_type_info(&self) -> &'static TypeInfo
Typed::type_info.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FromTemplate for T
impl<T> FromTemplate for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T> GetPath for T
impl<T> GetPath for T
Source§fn reflect_path<'p>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path<'p>( &self, path: impl ReflectPath<'p>, ) -> Result<&(dyn PartialReflect + 'static), ReflectPathError<'p>>
path. Read moreSource§fn reflect_path_mut<'p>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
fn reflect_path_mut<'p>( &mut self, path: impl ReflectPath<'p>, ) -> Result<&mut (dyn PartialReflect + 'static), ReflectPathError<'p>>
path. Read moreSource§fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
fn path<'p, T>(
&self,
path: impl ReflectPath<'p>,
) -> Result<&T, ReflectPathError<'p>>where
T: Reflect,
path. Read moreSource§fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
fn path_mut<'p, T>(
&mut self,
path: impl ReflectPath<'p>,
) -> Result<&mut T, ReflectPathError<'p>>where
T: Reflect,
path. Read moreSource§impl<S> GetTupleStructField for Swhere
S: TupleStruct,
impl<S> GetTupleStructField for Swhere
S: TupleStruct,
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
impl<T> Reflectable for T
Source§impl<T> Template for T
impl<T> Template for T
Source§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a Template::Output.Source§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.