libutils_array/
comparisons.rs1use super::Array;
7
8use core::{
10 hash::{
11 Hash,
12 Hasher
13 },
14 cmp::Ordering
15};
16
17
18const impl<
24 Type: [const] PartialEq<Type>,
25 To: [const] AsRef<[Type]>,
26 const N: usize
27> PartialEq<To> for Array<Type, N> {
28 fn eq(&self, other: &To) -> bool {return self.as_ref().eq(other.as_ref())}
29}
30
31const impl<
33 Type: [const] PartialOrd<Type>,
34 To: [const] AsRef<[Type]>,
35 const N: usize
36> PartialOrd<To> for Array<Type, N> {
37 fn partial_cmp(&self, other: &To) -> Option<Ordering> {return self.as_ref().partial_cmp(other.as_ref())}
38}
39
40impl<Type: Hash, const N: usize> Hash for Array<Type, N> {
42 fn hash<Hashing: Hasher>(&self, state: &mut Hashing) {return Hash::hash(self.as_ref(), state)}
43}
44
45const impl<Type: [const] Eq, const N: usize> Eq for Array<Type, N> {}
47
48const impl<Type: [const] Ord, const N: usize> Ord for Array<Type, N> {
50 fn cmp(&self, other: &Self) -> Ordering {return self.as_ref().cmp(other.as_ref())}
51}