pub fn column_of_byte_offset(&self, tgt_offset:Bytes)
    -> Result<Column,LocationError<Column>> {
        use self::BoundsError::*;
        use LocationError::*;
        let line_index = self.line_index_of_byte_offset(tgt_offset)?;
        let mut offset = self.byte_offset_of_line_index(line_index)?;
        let mut column = 0.column();
        while offset < tgt_offset {
            match self.next_grapheme_offset(offset) {
                None      => return Err(BoundsError(TooBig)),
                Some(off) => {
                    offset  = off;
                    column += 1.column();
                }
            }
        }
        if offset != tgt_offset {
            Err(NotClusterBoundary(column))
        } else {
            Ok(column)
        }
    }
/// The column number of the given byte offset.
The column number of the given byte offset.
The column number of the given byte offset .
pub fn column_of_byte_offset(&self, tgt_offset:Bytes)
    -> Result<Column,LocationError<Column>> {
        use self::BoundsError::*;
        use LocationError::*;
        let line_index = self.line_index_of_byte_offset(tgt_offset)?;
        let mut offset = self.byte_offset_of_line_index(line_index)?;
        let mut column = 0.column();
        while offset < tgt_offset {
            match self.next_grapheme_offset(offset) {
                None      => return Err(BoundsError(TooBig)),
                Some(off) => {
                    offset  = off;
                    column += 1.column();
                }
            }
        }
        if offset != tgt_offset {
            Err(NotClusterBoundary(column))
        } else {
            Ok(column)
        }
    }
pub fn column_of_byte_offset ( & self , tgt_offset : Bytes ) -> Result < Column , LocationError < Column > > { use self :: BoundsError :: * ; use LocationError :: * ; let line_index = self . line_index_of_byte_offset ( tgt_offset ) ? ; let mut offset = self . byte_offset_of_line_index ( line_index ) ? ; let mut column = 0 . column ( ) ; while offset < tgt_offset { match self . next_grapheme_offset ( offset ) { None => return Err ( BoundsError ( TooBig ) ) , Some ( off ) => { offset = off ; column += 1 . column ( ) ; } } } if offset != tgt_offset { Err ( NotClusterBoundary ( column ) ) } else { Ok ( column ) } }
The column number of the given byte offset.
The column number of the given byte offset .
&self
tgt_offset
Bytes
&self
tgt_offset
Bytes