pub struct SourceFile {
pub matching_source: Fragment,
pub docs: Vec<DocComment>,
pub items: Vec<Item>,
}Available on crate feature
ast-models only.Expand description
An entire parsed source file – the root of the AST.
Fields§
§matching_source: FragmentThe whole source file.
docs: Vec<DocComment>Inner doc comments (//! and /*! */) documenting the file as a whole.
items: Vec<Item>The items declared in this file, in order.
Trait Implementations§
Source§impl AstNode for SourceFile
impl AstNode for SourceFile
Source§fn matching_source(&self) -> &Fragment
fn matching_source(&self) -> &Fragment
Get the Fragment of source code this node was parsed from.
Source§impl Clone for SourceFile
impl Clone for SourceFile
Source§impl Debug for SourceFile
impl Debug for SourceFile
Source§impl PartialEq for SourceFile
impl PartialEq for SourceFile
impl StructuralPartialEq for SourceFile
Auto Trait Implementations§
impl Forget for SourceFile
impl Freeze for SourceFile
impl RefUnwindSafe for SourceFile
impl Send for SourceFile
impl Sync for SourceFile
impl Unpin for SourceFile
impl UnsafeUnpin for SourceFile
impl UnwindSafe for SourceFile
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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