Struct i_slint_compiler::diagnostics::SourceFileInner
source · pub struct SourceFileInner { /* private fields */ }
Implementations§
source§impl SourceFileInner
impl SourceFileInner
pub fn new(path: PathBuf, source: String) -> Self
pub fn path(&self) -> &Path
sourcepub fn from_path_only(path: PathBuf) -> Rc<Self>
pub fn from_path_only(path: PathBuf) -> Rc<Self>
Create a SourceFile that has just a path, but no contents
sourcepub fn line_column(&self, offset: usize) -> (usize, usize)
pub fn line_column(&self, offset: usize) -> (usize, usize)
Returns a tuple with the line (starting at 1) and column number (starting at 1)
sourcepub fn offset(&self, line: usize, column: usize) -> usize
pub fn offset(&self, line: usize, column: usize) -> usize
Returns the offset that corresponds to the line/column
pub fn source(&self) -> Option<&str>
Trait Implementations§
source§impl Debug for SourceFileInner
impl Debug for SourceFileInner
source§impl Default for SourceFileInner
impl Default for SourceFileInner
source§fn default() -> SourceFileInner
fn default() -> SourceFileInner
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for SourceFileInner
impl Send for SourceFileInner
impl !Sync for SourceFileInner
impl Unpin for SourceFileInner
impl UnwindSafe for SourceFileInner
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