pub struct CompilationUnit {
pub package: Option<PackageDecl>,
pub imports: Vec<ImportDecl>,
pub type_decls: Vec<TypeDecl>,
pub module: Option<ModuleDecl>,
pub comments: Vec<Comment>,
}Expand description
A Java compilation unit (a single source file).
Fields§
§package: Option<PackageDecl>The package declaration, if present.
imports: Vec<ImportDecl>Import declarations.
type_decls: Vec<TypeDecl>Top-level type declarations.
module: Option<ModuleDecl>The module declaration, if present (for module-info.java).
comments: Vec<Comment>All comments in the source file.
Implementations§
Trait Implementations§
Source§impl Clone for CompilationUnit
impl Clone for CompilationUnit
Source§fn clone(&self) -> CompilationUnit
fn clone(&self) -> CompilationUnit
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 CompilationUnit
impl Debug for CompilationUnit
Source§impl Hash for CompilationUnit
impl Hash for CompilationUnit
Source§impl Parse for CompilationUnit
impl Parse for CompilationUnit
Source§fn parse(input: &ParseStream<'_>) -> Result<Self>
fn parse(input: &ParseStream<'_>) -> Result<Self>
Parse this type from the given
ParseStream.Source§impl PartialEq for CompilationUnit
impl PartialEq for CompilationUnit
Source§fn eq(&self, other: &CompilationUnit) -> bool
fn eq(&self, other: &CompilationUnit) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for CompilationUnit
impl StructuralPartialEq for CompilationUnit
Auto Trait Implementations§
impl Freeze for CompilationUnit
impl RefUnwindSafe for CompilationUnit
impl Send for CompilationUnit
impl Sync for CompilationUnit
impl Unpin for CompilationUnit
impl UnsafeUnpin for CompilationUnit
impl UnwindSafe for CompilationUnit
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