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

Convert to a usize.

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.