pub fn line_index_of_byte_offset_snapped(&self, offset:Bytes) -> Line {
        use BoundsError::*;
        match self.line_index_of_byte_offset(offset) {
            Ok(index)     => index,
            Err(TooSmall) => self.first_line_index(),
            Err(TooBig)   => self.last_line_index(),
        }
    }
/// The line index of the given byte offset. Snapped to the closest valid line index in case the
/// byte offset was invalid.
The line index of the given byte offset. Snapped to the closest valid line index in case the
byte offset was invalid.
The line index of the given byte offset . Snapped to the closest valid line index in case the byte offset was invalid .
pub fn line_index_of_byte_offset_snapped(&self, offset:Bytes) -> Line {
        use BoundsError::*;
        match self.line_index_of_byte_offset(offset) {
            Ok(index)     => index,
            Err(TooSmall) => self.first_line_index(),
            Err(TooBig)   => self.last_line_index(),
        }
    }
pub fn line_index_of_byte_offset_snapped ( & self , offset : Bytes ) -> Line { use BoundsError :: * ; match self . line_index_of_byte_offset ( offset ) { Ok ( index ) => index , Err ( TooSmall ) => self . first_line_index ( ) , Err ( TooBig ) => self . last_line_index ( ) , } }
The line index of the given byte offset.
The line index of the given byte offset .
&self
offset
Bytes
&self
offset
Bytes