pub struct FileRegistry { /* private fields */ }Expand description
Registry of all source files encountered during preprocessing
Implementations§
Source§impl FileRegistry
impl FileRegistry
pub fn new() -> Self
Sourcepub fn line_byte_offset(&self, id: FileId, line: u32) -> usize
pub fn line_byte_offset(&self, id: FileId, line: u32) -> usize
Compute the byte offset of the start of a 1-based line number in a file’s content. Returns the byte offset, or 0 if the line is out of range.
Sourcepub fn line_length(&self, id: FileId, line: u32) -> usize
pub fn line_length(&self, id: FileId, line: u32) -> usize
Get the length of a 1-based line in a file (excluding newline).
Trait Implementations§
Source§impl Clone for FileRegistry
impl Clone for FileRegistry
Source§fn clone(&self) -> FileRegistry
fn clone(&self) -> FileRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileRegistry
impl Debug for FileRegistry
Source§impl Default for FileRegistry
impl Default for FileRegistry
Source§fn default() -> FileRegistry
fn default() -> FileRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FileRegistry
impl RefUnwindSafe for FileRegistry
impl Send for FileRegistry
impl Sync for FileRegistry
impl Unpin for FileRegistry
impl UnsafeUnpin for FileRegistry
impl UnwindSafe for FileRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more