pub struct LocatedBuilder { /* private fields */ }
Expand description

Builder for a Located struct

Implementations§

source§

impl LocatedBuilder

source

pub fn new() -> Self

Create a new builder for Located with default values

source

pub fn pos(self, pos: impl Into<TextRange>) -> Self

Set the raw position

source

pub fn current_file(self, file: impl Into<FileId>) -> Self

Set the file identifier

source

pub fn path(self, path: impl Into<PathBuf>) -> Self

Set the source path

source

pub fn file_override(self, file_override: impl Into<FileOverride>) -> Self

Set the source file override

source

pub fn line_number(self, line_number: u32) -> Self

Set the resolved line number

source

pub fn column(self, column: u32) -> Self

Set the resolved column number

source

pub fn resolve(self, resolver: &impl Resolver) -> Self

Resolve the raw offset (see LocatedBuilder::pos) to line and column information

source

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

source

pub fn resolve_path(self, resolver: &impl FileIdResolver) -> Self

Resolve the given file id into a path name, and store it in this builder

source

pub fn finish<E>(self, inner: E) -> Located<E>

Build the final Located object from the given inner object

Trait Implementations§

source§

impl Default for LocatedBuilder

source§

fn default() -> LocatedBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.