Trait david_set::Cast
[−]
[src]
pub trait Cast: Copy + Eq { fn cast(self) -> usize; fn invalid() -> Self; }
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 cast(self) -> usize
Convert to a usize
.
fn invalid() -> Self
A unique invalid value for this type. If you cannot identify
an invalid value, then you don't get to use CastSet, since we
would need to store an Option<T>
which would probably double
the size of the set.