pub fn offset_of_line(&self, line: usize) -> usize {
        let max_line = self.measure::<LinesMetric>() + 1;
        if line > max_line {
            panic!("line number {} beyond last line {}", line, max_line);
        } else if line == max_line {
            return self.len();
        }
        self.convert_metrics::<LinesMetric, BaseMetric>(line)
    }
/// Return the byte offset corresponding to the line number `line`.
/// If `line` is equal to one plus the current number of lines,
/// this returns the offset of the end of the rope. Arguments higher
/// than this will panic.
///
/// The line number is 0-based.
///
/// Time complexity: O(log n)
///
/// # Panics
///
/// This function will panic if `line > self.measure::<LinesMetric>() + 1`.
/// Callers are expected to validate their input.
Return the byte offset corresponding to the line number `line`.
If `line` is equal to one plus the current number of lines,
this returns the offset of the end of the rope. Arguments higher
than this will panic.

The line number is 0-based.


Return the byte offset corresponding to the line number ` line ` . If ` line ` is equal to one plus the current number of lines this returns the offset of the end of the rope . Arguments higher than this will panic . The line number is 0 - based .
pub fn offset_of_line(&self, line: usize) -> usize {
        let max_line = self.measure::<LinesMetric>() + 1;
        if line > max_line {
            panic!("line number {} beyond last line {}", line, max_line);
        } else if line == max_line {
            return self.len();
        }
        self.convert_metrics::<LinesMetric, BaseMetric>(line)
    }
pub fn offset_of_line ( & self , line : usize ) -> usize { let max_line = self . measure :: < LinesMetric > ( ) + 1 ; if line > max_line { panic ! ( " " line max_line ) ; } else if line == max_line { return self . len ( ) ; } self . convert_metrics :: < LinesMetric , BaseMetric > ( line ) }
Return the byte offset corresponding to the line number `line`.
Return the byte offset corresponding to the line number ` line ` .
&self
line
usize
panics
This function will panic if `line > self.measure::() + 1`.
Callers are expected to validate their input.
This function will panic if ` line > self . measure :: () + 1 ` . Callers are expected to validate their input .