tabled/features/style/offset.rs
1/// The structure represents an offset in a text.
2#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
3pub enum Offset {
4 /// An offset from the start.
5 Begin(usize),
6 /// An offset from the end.
7 End(usize),
8}
9
10impl From<Offset> for papergrid::Offset {
11 fn from(o: Offset) -> Self {
12 match o {
13 Offset::Begin(i) => papergrid::Offset::Begin(i),
14 Offset::End(i) => papergrid::Offset::End(i),
15 }
16 }
17}