pub struct DocumentPrinter<'a, W: Write> { /* private fields */ }
Expand description
A printer for WAC documents.
Implementations§
Source§impl<'a, W: Write> DocumentPrinter<'a, W>
impl<'a, W: Write> DocumentPrinter<'a, W>
Sourcepub fn new(writer: W, source: &'a str, space: Option<&'static str>) -> Self
pub fn new(writer: W, source: &'a str, space: Option<&'static str>) -> Self
Creates a new document printer for the given write.
If space
is None
, then the printer will use four spaces for
indentation.
Sourcepub fn package_directive(&mut self, directive: &PackageDirective<'_>) -> Result
pub fn package_directive(&mut self, directive: &PackageDirective<'_>) -> Result
Prints the given package directive.
Sourcepub fn docs(&mut self, docs: &[DocComment<'_>]) -> Result
pub fn docs(&mut self, docs: &[DocComment<'_>]) -> Result
Prints the given doc comments.
Sourcepub fn import_statement(&mut self, statement: &ImportStatement<'_>) -> Result
pub fn import_statement(&mut self, statement: &ImportStatement<'_>) -> Result
Prints the given import statement.
Sourcepub fn import_type(&mut self, ty: &ImportType<'_>) -> Result
pub fn import_type(&mut self, ty: &ImportType<'_>) -> Result
Prints the given import type.
Sourcepub fn package_path(&mut self, path: &PackagePath<'_>) -> Result
pub fn package_path(&mut self, path: &PackagePath<'_>) -> Result
Prints the given package path.
Sourcepub fn inline_interface(&mut self, iface: &InlineInterface<'_>) -> Result
pub fn inline_interface(&mut self, iface: &InlineInterface<'_>) -> Result
Prints the given inline interface.
Sourcepub fn interface_item(&mut self, item: &InterfaceItem<'_>) -> Result
pub fn interface_item(&mut self, item: &InterfaceItem<'_>) -> Result
Prints the given interface export.
Sourcepub fn item_type_decl(&mut self, decl: &ItemTypeDecl<'_>) -> Result
pub fn item_type_decl(&mut self, decl: &ItemTypeDecl<'_>) -> Result
Prints the given type declaration.
Sourcepub fn resource_decl(&mut self, decl: &ResourceDecl<'_>) -> Result
pub fn resource_decl(&mut self, decl: &ResourceDecl<'_>) -> Result
Prints the given resource declaration.
Sourcepub fn resource_method(&mut self, method: &ResourceMethod<'_>) -> Result
pub fn resource_method(&mut self, method: &ResourceMethod<'_>) -> Result
Prints the given resource method.
Sourcepub fn constructor(&mut self, constructor: &Constructor<'_>) -> Result
pub fn constructor(&mut self, constructor: &Constructor<'_>) -> Result
Prints the given constructor.
Sourcepub fn func_type_ref(&mut self, ty: &FuncTypeRef<'_>) -> Result
pub fn func_type_ref(&mut self, ty: &FuncTypeRef<'_>) -> Result
Prints the given function type reference.
Sourcepub fn variant_decl(&mut self, decl: &VariantDecl<'_>) -> Result
pub fn variant_decl(&mut self, decl: &VariantDecl<'_>) -> Result
Prints the given variant declaration.
Sourcepub fn variant_case(&mut self, case: &VariantCase<'_>) -> Result
pub fn variant_case(&mut self, case: &VariantCase<'_>) -> Result
Prints the given variant case.
Sourcepub fn record_decl(&mut self, decl: &RecordDecl<'_>) -> Result
pub fn record_decl(&mut self, decl: &RecordDecl<'_>) -> Result
Prints the given record declaration.
Sourcepub fn flags_decl(&mut self, decl: &FlagsDecl<'_>) -> Result
pub fn flags_decl(&mut self, decl: &FlagsDecl<'_>) -> Result
Prints the given flags declaration.
Sourcepub fn type_alias(&mut self, alias: &TypeAlias<'_>) -> Result
pub fn type_alias(&mut self, alias: &TypeAlias<'_>) -> Result
Prints the given type alias.
Sourcepub fn interface_export(&mut self, export: &InterfaceExport<'_>) -> Result
pub fn interface_export(&mut self, export: &InterfaceExport<'_>) -> Result
Prints the given interface export.
Sourcepub fn type_statement(&mut self, stmt: &TypeStatement<'_>) -> Result
pub fn type_statement(&mut self, stmt: &TypeStatement<'_>) -> Result
Prints the given type statement.
Sourcepub fn interface_decl(&mut self, decl: &InterfaceDecl<'_>) -> Result
pub fn interface_decl(&mut self, decl: &InterfaceDecl<'_>) -> Result
Prints the given interface declaration.
Sourcepub fn world_decl(&mut self, decl: &WorldDecl<'_>) -> Result
pub fn world_decl(&mut self, decl: &WorldDecl<'_>) -> Result
Prints the given world declaration.
Sourcepub fn world_item(&mut self, item: &WorldItem<'_>) -> Result
pub fn world_item(&mut self, item: &WorldItem<'_>) -> Result
Prints the given world item.
Sourcepub fn world_import(&mut self, import: &WorldImport<'_>) -> Result
pub fn world_import(&mut self, import: &WorldImport<'_>) -> Result
Prints the given world import.
Sourcepub fn world_export(&mut self, export: &WorldExport<'_>) -> Result
pub fn world_export(&mut self, export: &WorldExport<'_>) -> Result
Prints the given world export.
Sourcepub fn world_item_path(&mut self, path: &WorldItemPath<'_>) -> Result
pub fn world_item_path(&mut self, path: &WorldItemPath<'_>) -> Result
Prints the given world item path.
Sourcepub fn named_world_item(&mut self, item: &NamedWorldItem<'_>) -> Result
pub fn named_world_item(&mut self, item: &NamedWorldItem<'_>) -> Result
Prints the given named world item.
Sourcepub fn extern_type(&mut self, ty: &ExternType<'_>) -> Result
pub fn extern_type(&mut self, ty: &ExternType<'_>) -> Result
Prints the given extern type.
Sourcepub fn world_include(&mut self, include: &WorldInclude<'_>) -> Result
pub fn world_include(&mut self, include: &WorldInclude<'_>) -> Result
Prints the given world include.
Sourcepub fn world_ref(&mut self, reference: &WorldRef<'_>) -> Result
pub fn world_ref(&mut self, reference: &WorldRef<'_>) -> Result
Prints the given world reference.
Sourcepub fn let_statement(&mut self, stmt: &LetStatement<'_>) -> Result
pub fn let_statement(&mut self, stmt: &LetStatement<'_>) -> Result
Prints the given let statement.
Sourcepub fn primary_expr(&mut self, expr: &PrimaryExpr<'_>) -> Result
pub fn primary_expr(&mut self, expr: &PrimaryExpr<'_>) -> Result
Prints the given primary expression.
Sourcepub fn postfix_expr(&mut self, expr: &PostfixExpr<'_>) -> Result
pub fn postfix_expr(&mut self, expr: &PostfixExpr<'_>) -> Result
Prints the given postfix expression.
Sourcepub fn access_expr(&mut self, expr: &AccessExpr<'_>) -> Result
pub fn access_expr(&mut self, expr: &AccessExpr<'_>) -> Result
Prints the given access expression.
Sourcepub fn named_access_expr(&mut self, expr: &NamedAccessExpr<'_>) -> Result
pub fn named_access_expr(&mut self, expr: &NamedAccessExpr<'_>) -> Result
Prints the given named access expression.
Sourcepub fn export_statement(&mut self, stmt: &ExportStatement<'_>) -> Result
pub fn export_statement(&mut self, stmt: &ExportStatement<'_>) -> Result
Prints the given export statement.