pub struct SourceRange {
pub file: String,
pub start_byte: u64,
pub end_byte: u64,
pub start_line: u32,
}Expand description
A half-open byte range in one file, with the line its start falls on.
Byte offsets rather than lines alone: a line number cannot say where inside a line something begins, and clone fragments regularly do.
Fields§
§file: StringPath as the analysis spells it — see CompilerIr::anchored_at for
what it is spelled against.
start_byte: u64First byte covered.
end_byte: u64One past the last byte covered.
start_line: u32Line the first byte falls on, counting from one.
Trait Implementations§
Source§impl Clone for SourceRange
impl Clone for SourceRange
Source§fn clone(&self) -> SourceRange
fn clone(&self) -> SourceRange
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 SourceRange
impl Debug for SourceRange
Source§impl<'de> Deserialize<'de> for SourceRange
impl<'de> Deserialize<'de> for SourceRange
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for SourceRange
Source§impl PartialEq for SourceRange
impl PartialEq for SourceRange
Source§impl Serialize for SourceRange
impl Serialize for SourceRange
impl StructuralPartialEq for SourceRange
Auto Trait Implementations§
impl Freeze for SourceRange
impl RefUnwindSafe for SourceRange
impl Send for SourceRange
impl Sync for SourceRange
impl Unpin for SourceRange
impl UnsafeUnpin for SourceRange
impl UnwindSafe for SourceRange
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