pub struct Item<'doc> { /* private fields */ }Expand description
A borrowed view of a raw source item.
Implementations§
Source§impl<'doc> Item<'doc>
impl<'doc> Item<'doc>
Sourcepub fn line_ending(self) -> LineEnding
pub fn line_ending(self) -> LineEnding
The final physical line ending of the item.
Sourcepub fn content_span(self) -> Range<usize> ⓘ
pub fn content_span(self) -> Range<usize> ⓘ
Item bytes excluding the final line ending.
Sourcepub fn comment_text(self) -> Option<&'doc str>
pub fn comment_text(self) -> Option<&'doc str>
Comment body after #, preserving its spaces.
Sourcepub fn diagnostic(self) -> Option<&'doc Diagnostic>
pub fn diagnostic(self) -> Option<&'doc Diagnostic>
The primary syntax or policy diagnostic retained on this item, if any.
Sourcepub fn invalid_code(self) -> Option<DiagnosticCode>
pub fn invalid_code(self) -> Option<DiagnosticCode>
Stable primary diagnostic identity, convenient for source-preserving checks.
Trait Implementations§
Auto Trait Implementations§
impl<'doc> Freeze for Item<'doc>
impl<'doc> RefUnwindSafe for Item<'doc>
impl<'doc> Send for Item<'doc>
impl<'doc> Sync for Item<'doc>
impl<'doc> Unpin for Item<'doc>
impl<'doc> UnsafeUnpin for Item<'doc>
impl<'doc> UnwindSafe for Item<'doc>
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