#[derive(Debug, Clone, Eq, PartialEq)]
pub struct Cursor {
byte_offset: usize,
char_offset: usize,
line: usize,
column: usize,
}
impl Cursor {
pub(in crate::reader) fn new(
byte_offset: usize,
char_offset: usize,
line: usize,
column: usize,
) -> Cursor {
Cursor {
byte_offset,
char_offset,
line,
column,
}
}
#[inline]
pub fn byte_offset(&self) -> usize {
self.byte_offset
}
#[inline]
pub fn char_offset(&self) -> usize {
self.char_offset
}
#[inline]
pub fn line(&self) -> usize {
self.line
}
#[inline]
pub fn column(&self) -> usize {
self.column
}
}