pub struct SourceEntry {
pub span: Span,
pub kind: EntryKind,
pub name: Option<String>,
pub ty_info: Option<String>,
}Expand description
A single entry in the source map.
Fields§
§span: SpanSource span for this entry.
kind: EntryKindWhat kind of entry this is.
name: Option<String>Optional name associated with this entry.
ty_info: Option<String>Optional type information as a display string.
Implementations§
Source§impl SourceEntry
impl SourceEntry
Sourcepub fn with_name(span: Span, kind: EntryKind, name: &str) -> Self
pub fn with_name(span: Span, kind: EntryKind, name: &str) -> Self
Create a source entry with a name.
Sourcepub fn with_name_and_type(
span: Span,
kind: EntryKind,
name: &str,
ty: &str,
) -> Self
pub fn with_name_and_type( span: Span, kind: EntryKind, name: &str, ty: &str, ) -> Self
Create a source entry with name and type info.
Sourcepub fn contains_offset(&self, offset: usize) -> bool
pub fn contains_offset(&self, offset: usize) -> bool
Check whether a byte offset falls within this entry’s span.
Trait Implementations§
Source§impl Clone for SourceEntry
impl Clone for SourceEntry
Source§fn clone(&self) -> SourceEntry
fn clone(&self) -> SourceEntry
Returns a duplicate of the value. Read more
1.0.0 · 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 SourceEntry
impl Debug for SourceEntry
Source§impl PartialEq for SourceEntry
impl PartialEq for SourceEntry
impl StructuralPartialEq for SourceEntry
Auto Trait Implementations§
impl Freeze for SourceEntry
impl RefUnwindSafe for SourceEntry
impl Send for SourceEntry
impl Sync for SourceEntry
impl Unpin for SourceEntry
impl UnsafeUnpin for SourceEntry
impl UnwindSafe for SourceEntry
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