Struct glsl_lang_pp::processor::expand::ExpandLocation
source · pub struct ExpandLocation {
current_file: FileId,
line_map: LineMap,
line_override: Option<(u32, ParsedLine)>,
}
Fields§
§current_file: FileId
§line_map: LineMap
§line_override: Option<(u32, ParsedLine)>
Implementations§
source§impl ExpandLocation
impl ExpandLocation
pub fn new(current_file: FileId) -> Self
pub fn current_file(&self) -> FileId
pub fn line_override(&self) -> Option<&(u32, ParsedLine)>
pub fn offset_to_raw_line_and_col(&self, offset: TextSize) -> (u32, u32)
pub fn offset_to_line_and_col(&self, offset: TextSize) -> (u32, u32)
pub fn line_to_line_number(&self, raw_line: u32) -> u32
pub fn add_override(&mut self, current_offset: TextSize, line: ParsedLine)
pub fn string(&self) -> LocationString<'_>
Trait Implementations§
source§impl HasFileNumber for ExpandLocation
impl HasFileNumber for ExpandLocation
source§fn current_file(&self) -> FileId
fn current_file(&self) -> FileId
Return the current file identifier
Auto Trait Implementations§
impl Freeze for ExpandLocation
impl RefUnwindSafe for ExpandLocation
impl Send for ExpandLocation
impl Sync for ExpandLocation
impl Unpin for ExpandLocation
impl UnwindSafe for ExpandLocation
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> 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