pub struct ProgramUnit {
pub name: String,
pub ctors: Vec<CtorFunc>,
pub services: Vec<ServiceExpo>,
pub types: Vec<Type>,
pub docs: Vec<String>,
pub annotations: Vec<Annotation>,
}Expand description
AST node describing a program block.
A program is an entry point that:
- declares constructor functions in
constructors { ... }, - exposes one or more services in
services { ... }, - may define shared types in
types { ... }, - may contain documentation comments and annotations.
Call ProgramUnit::normalize after construction to populate entry_id on each constructor.
Fields§
§name: String§ctors: Vec<CtorFunc>§services: Vec<ServiceExpo>§types: Vec<Type>§docs: Vec<String>§annotations: Vec<Annotation>Implementations§
Source§impl ProgramUnit
impl ProgramUnit
Trait Implementations§
Source§impl Clone for ProgramUnit
impl Clone for ProgramUnit
Source§fn clone(&self) -> ProgramUnit
fn clone(&self) -> ProgramUnit
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 ProgramUnit
impl Debug for ProgramUnit
Source§impl Default for ProgramUnit
impl Default for ProgramUnit
Source§fn default() -> ProgramUnit
fn default() -> ProgramUnit
Returns the “default value” for a type. Read more
Source§impl PartialEq for ProgramUnit
impl PartialEq for ProgramUnit
Source§fn eq(&self, other: &ProgramUnit) -> bool
fn eq(&self, other: &ProgramUnit) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ProgramUnit
Auto Trait Implementations§
impl Freeze for ProgramUnit
impl RefUnwindSafe for ProgramUnit
impl Send for ProgramUnit
impl Sync for ProgramUnit
impl Unpin for ProgramUnit
impl UnsafeUnpin for ProgramUnit
impl UnwindSafe for ProgramUnit
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