Struct lang_util::located::LocatedBuilder
source · pub struct LocatedBuilder {
pos: TextRange,
current_file: Option<FileId>,
path: Option<PathBuf>,
file_override: FileOverride,
line_number: u32,
column: u32,
}
Expand description
Builder for a Located struct
Fields§
§pos: TextRange
Position at which the error occurred
current_file: Option<FileId>
File identifier for the error
path: Option<PathBuf>
Path corresponding to the file identifier
file_override: FileOverride
Overriden file location
line_number: u32
Resolved line number
column: u32
Resolved column number
Implementations§
source§impl LocatedBuilder
impl LocatedBuilder
sourcepub fn current_file(self, file: impl Into<FileId>) -> Self
pub fn current_file(self, file: impl Into<FileId>) -> Self
Set the file identifier
sourcepub fn file_override(self, file_override: impl Into<FileOverride>) -> Self
pub fn file_override(self, file_override: impl Into<FileOverride>) -> Self
Set the source file override
sourcepub fn line_number(self, line_number: u32) -> Self
pub fn line_number(self, line_number: u32) -> Self
Set the resolved line number
sourcepub fn resolve(self, resolver: &impl Resolver) -> Self
pub fn resolve(self, resolver: &impl Resolver) -> Self
Resolve the raw offset (see LocatedBuilder::pos) to line and column information
sourcepub fn resolve_file(self, resolver: &(impl Resolver + HasFileNumber)) -> Self
pub fn resolve_file(self, resolver: &(impl Resolver + HasFileNumber)) -> Self
Resolve the raw offset (see LocatedBuilder::pos) to line and column information, and set the current file information
sourcepub fn resolve_path(self, resolver: &impl FileIdResolver) -> Self
pub fn resolve_path(self, resolver: &impl FileIdResolver) -> Self
Resolve the given file id into a path name, and store it in this builder
Trait Implementations§
source§impl Default for LocatedBuilder
impl Default for LocatedBuilder
source§fn default() -> LocatedBuilder
fn default() -> LocatedBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LocatedBuilder
impl RefUnwindSafe for LocatedBuilder
impl Send for LocatedBuilder
impl Sync for LocatedBuilder
impl Unpin for LocatedBuilder
impl UnwindSafe for LocatedBuilder
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