pub struct FileSpan {
pub file: CodeMap,
pub span: Span,
}
Expand description
A file, and a line and column range within it.
Fields§
§file: CodeMap
§span: Span
Implementations§
source§impl FileSpan
impl FileSpan
sourcepub fn new(filename: String, source: String) -> FileSpan
pub fn new(filename: String, source: String) -> FileSpan
Creates an new FileSpan
covering the entire file.
sourcepub fn source_span(&self) -> &str
pub fn source_span(&self) -> &str
Resolve the span.
sourcepub fn as_ref(&self) -> FileSpanRef<'_>
pub fn as_ref(&self) -> FileSpanRef<'_>
Cheap reference to the span.
sourcepub fn resolve_span(&self) -> ResolvedSpan
pub fn resolve_span(&self) -> ResolvedSpan
Resolve the span to lines and columns.
sourcepub fn resolve(&self) -> ResolvedFileSpan
pub fn resolve(&self) -> ResolvedFileSpan
Resolve the span to lines and columns.
Trait Implementations§
source§impl Allocative for FileSpan
impl Allocative for FileSpan
source§impl PartialEq for FileSpan
impl PartialEq for FileSpan
impl Eq for FileSpan
impl StructuralPartialEq for FileSpan
Auto Trait Implementations§
impl RefUnwindSafe for FileSpan
impl Send for FileSpan
impl Sync for FileSpan
impl Unpin for FileSpan
impl UnwindSafe for FileSpan
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.