Struct rustc_utils::source_map::range::CharRange
source · pub struct CharRange {
pub start: CharPos,
pub end: CharPos,
pub filename: FilenameIndex,
}
Expand description
Data structure for sharing spans outside rustc.
Rustc uses byte indexes to describe ranges of source code, whereas
most Javascript-based editors I’ve encountered (e.g. VSCode) use
character-based (really grapheme-based) indexes. This data structure
along with ByteRange
helps convert between the two representations.
Fields§
§start: CharPos
§end: CharPos
§filename: FilenameIndex
Implementations§
Trait Implementations§
source§impl PartialEq for CharRange
impl PartialEq for CharRange
impl Copy for CharRange
impl Eq for CharRange
impl StructuralEq for CharRange
impl StructuralPartialEq for CharRange
Auto Trait Implementations§
impl RefUnwindSafe for CharRange
impl Send for CharRange
impl Sync for CharRange
impl Unpin for CharRange
impl UnwindSafe for CharRange
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