Trait RecordIndex

Source
pub unsafe trait RecordIndex:
    Sealed
    + Eq
    + Copy
    + Send
    + Sync
    + Ord
    + Hash {
    // Required methods
    fn contains_bounds(container: &Bounds<Self>, bounds: &Bounds<Self>) -> bool;
    fn in_bounds(&self, bounds: &Bounds<Self>) -> bool;
    fn enclose_index(bounds: &mut Bounds<Self>, index: Self);
    fn empty_bounds() -> Bounds<Self>;
    fn bounds_for_index(index: Self) -> Bounds<Self>;
}
Expand description

A type suitable for use as an index into a collection of records.

This trait is currently sealed in order to make changes more easily, and because there currently is no use case for implementing it outside this crate. If you have a use case for this, please file an issue.

§Safety

Consumers of this trait must be able to rely on the correctness of the provided methods in unsafe contexts.

All auxiliary traits required by this trait, such as Eq, Ord or Hash, must be implemented correctly.

If two indices compare unequal, then they must not access the same record in a collection.

Required Methods§

Source

fn contains_bounds(container: &Bounds<Self>, bounds: &Bounds<Self>) -> bool

Determine if a set of bounds contains another set of bounds.

Source

fn in_bounds(&self, bounds: &Bounds<Self>) -> bool

Determine if this index is contained inside the provided bounds.

Source

fn enclose_index(bounds: &mut Bounds<Self>, index: Self)

Expand these bounds to include the given index.

Source

fn empty_bounds() -> Bounds<Self>

Returns a set of bounds that are empty (zero extent).

Source

fn bounds_for_index(index: Self) -> Bounds<Self>

Returns a set of bounds that exactly contain only the provided index.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl RecordIndex for u32

Source§

fn contains_bounds(container: &Bounds<Self>, bounds: &Bounds<Self>) -> bool

Source§

fn in_bounds(&self, bounds: &Bounds<Self>) -> bool

Source§

fn enclose_index(bounds: &mut Bounds<Self>, index: Self)

Source§

fn empty_bounds() -> Bounds<Self>

Source§

fn bounds_for_index(index: Self) -> Bounds<Self>

Source§

impl RecordIndex for u64

Source§

fn contains_bounds(container: &Bounds<Self>, bounds: &Bounds<Self>) -> bool

Source§

fn in_bounds(&self, bounds: &Bounds<Self>) -> bool

Source§

fn enclose_index(bounds: &mut Bounds<Self>, index: Self)

Source§

fn empty_bounds() -> Bounds<Self>

Source§

fn bounds_for_index(index: Self) -> Bounds<Self>

Source§

impl RecordIndex for usize

Source§

fn contains_bounds(container: &Bounds<Self>, bounds: &Bounds<Self>) -> bool

Source§

fn in_bounds(&self, bounds: &Bounds<Self>) -> bool

Source§

fn enclose_index(bounds: &mut Bounds<Self>, index: Self)

Source§

fn empty_bounds() -> Bounds<Self>

Source§

fn bounds_for_index(index: Self) -> Bounds<Self>

Source§

impl<I0: RecordIndex, I1: RecordIndex> RecordIndex for (I0, I1)

Source§

fn contains_bounds(container: &Bounds<Self>, bounds: &Bounds<Self>) -> bool

Source§

fn in_bounds(&self, bounds: &Bounds<Self>) -> bool

Source§

fn enclose_index(bounds: &mut Bounds<Self>, index: Self)

Source§

fn empty_bounds() -> Bounds<Self>

Source§

fn bounds_for_index(index: Self) -> Bounds<Self>

Source§

impl<I0: RecordIndex, I1: RecordIndex, I2: RecordIndex> RecordIndex for (I0, I1, I2)

Source§

fn contains_bounds(container: &Bounds<Self>, bounds: &Bounds<Self>) -> bool

Source§

fn in_bounds(&self, bounds: &Bounds<Self>) -> bool

Source§

fn enclose_index(bounds: &mut Bounds<Self>, index: Self)

Source§

fn empty_bounds() -> Bounds<Self>

Source§

fn bounds_for_index(index: Self) -> Bounds<Self>

Source§

impl<I0: RecordIndex, I1: RecordIndex, I2: RecordIndex, I3: RecordIndex> RecordIndex for (I0, I1, I2, I3)

Source§

fn contains_bounds(container: &Bounds<Self>, bounds: &Bounds<Self>) -> bool

Source§

fn in_bounds(&self, bounds: &Bounds<Self>) -> bool

Source§

fn enclose_index(bounds: &mut Bounds<Self>, index: Self)

Source§

fn empty_bounds() -> Bounds<Self>

Source§

fn bounds_for_index(index: Self) -> Bounds<Self>

Source§

impl<I0: RecordIndex, I1: RecordIndex, I2: RecordIndex, I3: RecordIndex, I4: RecordIndex> RecordIndex for (I0, I1, I2, I3, I4)

Source§

fn contains_bounds(container: &Bounds<Self>, bounds: &Bounds<Self>) -> bool

Source§

fn in_bounds(&self, bounds: &Bounds<Self>) -> bool

Source§

fn enclose_index(bounds: &mut Bounds<Self>, index: Self)

Source§

fn empty_bounds() -> Bounds<Self>

Source§

fn bounds_for_index(index: Self) -> Bounds<Self>

Implementors§