substrate::layout::tracks

Trait Tracks

Source
pub trait Tracks {
    // Required methods
    fn try_track(&self, idx: i64) -> Option<Span>;
    fn try_range(&self) -> (Option<i64>, Option<i64>);

    // Provided method
    fn track(&self, idx: i64) -> Span { ... }
}
Expand description

A set of tracks.

Required Methods§

Source

fn try_track(&self, idx: i64) -> Option<Span>

The track at the given index.

Source

fn try_range(&self) -> (Option<i64>, Option<i64>)

The range of valid indices, as a tuple (min, max).

If there is no min/max index, implementers should return None.

Provided Methods§

Source

fn track(&self, idx: i64) -> Span

The track at the given index, panicking if the index is out of bounds.

Implementors§