Skip to main content

IndexValue

Trait IndexValue 

Source
pub trait IndexValue: Copy {
    // Required method
    fn position(self) -> i64;

    // Provided method
    fn bounds(values: &[Self]) -> (i64, i64) { ... }
}
Expand description

A value that names a position along an axis: a Boolean or an integer. A float index value names the whole number it equals within the comparison tolerance, which crate::structure::float_position reads before any table holds it.

Required Methods§

Source

fn position(self) -> i64

The position the value names, where a negative one counts back from the end.

Provided Methods§

Source

fn bounds(values: &[Self]) -> (i64, i64)

The least and greatest positions that values name, which mean nothing where values is empty.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IndexValue for bool

Source§

fn position(self) -> i64

Source§

impl IndexValue for i8

Source§

fn position(self) -> i64

Source§

fn bounds(values: &[i8]) -> (i64, i64)

Source§

impl IndexValue for i16

Source§

fn position(self) -> i64

Source§

fn bounds(values: &[i16]) -> (i64, i64)

Source§

impl IndexValue for i32

Source§

fn position(self) -> i64

Source§

fn bounds(values: &[i32]) -> (i64, i64)

Source§

impl IndexValue for i64

Source§

fn position(self) -> i64

Source§

fn bounds(values: &[i64]) -> (i64, i64)

Source§

impl IndexValue for u8

Source§

fn position(self) -> i64

Source§

fn bounds(values: &[u8]) -> (i64, i64)

Source§

impl IndexValue for u16

Source§

fn position(self) -> i64

Source§

fn bounds(values: &[u16]) -> (i64, i64)

Source§

impl IndexValue for u32

Source§

fn position(self) -> i64

Source§

fn bounds(values: &[u32]) -> (i64, i64)

Implementors§