pub struct LineIndex { /* private fields */ }Implementations§
Source§impl LineIndex
impl LineIndex
pub fn new() -> Self
Sourcepub fn new_starting_at(start_byte: usize) -> Self
pub fn new_starting_at(start_byte: usize) -> Self
Construct a line index that begins at the given byte offset. Bytes
before start_byte are never scanned and never appear in line_range.
Used by --tail to skip past the head of the source.
Sourcepub fn set_head_cap(&mut self, cap: usize)
pub fn set_head_cap(&mut self, cap: usize)
Limit the index to the first N logical lines from the start point.
line_count clamps to this and extend_to_byte stops scanning
past it. Used by --head N.
pub fn line_count(&self) -> usize
pub fn extend_to_line(&mut self, n: usize, src: &dyn Source)
pub fn extend_to_end(&mut self, src: &dyn Source)
pub fn notice_new_bytes(&mut self, src: &dyn Source)
Auto Trait Implementations§
impl Freeze for LineIndex
impl RefUnwindSafe for LineIndex
impl Send for LineIndex
impl Sync for LineIndex
impl Unpin for LineIndex
impl UnsafeUnpin for LineIndex
impl UnwindSafe for LineIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more