pub struct Document<'a> {
pub docs: Vec<DocComment<'a>>,
pub directive: PackageDirective<'a>,
pub statements: Vec<Statement<'a>>,
}
Expand description
Represents a top-level WAC document.
Fields§
§docs: Vec<DocComment<'a>>
The doc comments for the package.
directive: PackageDirective<'a>
The package directive of the document.
statements: Vec<Statement<'a>>
The statements in the document.
Implementations§
Source§impl<'a> Document<'a>
impl<'a> Document<'a>
Sourcepub fn parse(source: &'a str) -> ParseResult<Self>
pub fn parse(source: &'a str) -> ParseResult<Self>
Parses the given source string as a document.
The given path is used for error reporting.
Sourcepub fn resolve(
&self,
packages: IndexMap<BorrowedPackageKey<'a>, Vec<u8>>,
) -> ResolutionResult<Resolution<'_>>
pub fn resolve( &self, packages: IndexMap<BorrowedPackageKey<'a>, Vec<u8>>, ) -> ResolutionResult<Resolution<'_>>
Resolves the document.
The returned resolution contains an encodable composition graph.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Document<'a>
impl<'a> RefUnwindSafe for Document<'a>
impl<'a> Send for Document<'a>
impl<'a> Sync for Document<'a>
impl<'a> Unpin for Document<'a>
impl<'a> UnwindSafe for Document<'a>
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