[][src]Struct asciifile::line_number_cache::LineNumberCache

pub struct LineNumberCache { /* fields omitted */ }

Methods

impl LineNumberCache
[src]

Return a LineNumberCache with UNIX-style line breaks (single \n byte) at byte offsets given in linebreaks.

Return the line number at byte_offset. Identical to row() + 1.

This does not detect errors caused by byte_offsets that are out of range. Prefer the safe API of the Position struct instead.

Return the column of the characters position within the file.

The column is zero based, meaning the first characters of a line/row is positioned at column 0.

This does not detect errors caused by byte_offsets that are out of range. Prefer the safe API of the Position struct instead.

Return the row of the character's position within the file.

This does not detect errors caused by byte_offsets that are out of range. Prefer the safe API of the Position struct instead.

Get row and column at once. Equivalent to calling row(&self, byte_offset: usize) and column(&self, byte_offset: usize).

This method exists because most of the time you want both. And it's more efficient to look up both at once.

This does not detect errors caused by byte_offsets that are out of range. Prefer the safe API of the Position struct instead.

Trait Implementations

impl Debug for LineNumberCache
[src]

Auto Trait Implementations

impl Send for LineNumberCache

impl Sync for LineNumberCache

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]