Trait tinyset::tinyset::HasInvalid
[−]
[src]
pub trait HasInvalid: Copy + Eq + Hash { fn invalid() -> Self; fn hash_usize(self) -> usize { ... } }
Trait for any type that can be converted to a usize
. This could
actually be a hash function, but we will assume that it is fast,
so I'm not calling it Hash
.
Required Methods
fn invalid() -> Self
A unique invalid value for this type. If you cannot identify
an invalid value, then you don't get to use TinySet, since we
would need to store an Option<T>
which would probably double
the size of the set.
Provided Methods
fn hash_usize(self) -> usize
Hash to a usize
.