pub struct CompilationUnit {
pub global_vars: Vec<VariableBlock>,
pub var_config: Vec<ConfigVariable>,
pub pous: Vec<Pou>,
pub implementations: Vec<Implementation>,
pub interfaces: Vec<Interface>,
pub user_types: Vec<UserTypeDeclaration>,
pub file: FileMarker,
pub linkage: LinkageType,
}Fields§
§global_vars: Vec<VariableBlock>§var_config: Vec<ConfigVariable>§pous: Vec<Pou>List of POU definitions (signature and some additional metadata)
implementations: Vec<Implementation>List of statements within a POU body
interfaces: Vec<Interface>§user_types: Vec<UserTypeDeclaration>§file: FileMarker§linkage: LinkageTypeImplementations§
Source§impl CompilationUnit
impl CompilationUnit
pub fn new(file_name: &'static str) -> Self
pub fn with_implementations(self, implementations: Vec<Implementation>) -> Self
pub fn with_linkage(self, linkage: LinkageType) -> Self
Sourcepub fn import(&mut self, other: CompilationUnit)
pub fn import(&mut self, other: CompilationUnit)
imports all elements of the other CompilationUnit into this CompilationUnit
this will import all global_vars, units, implementations and types. The imported structs are moved from the other unit into this unit
§Arguments
other the other CompilationUnit to import the elements from.
Trait Implementations§
Source§impl Debug for CompilationUnit
impl Debug for CompilationUnit
Source§impl<'de> Deserialize<'de> for CompilationUnitwhere
'de: 'static,
impl<'de> Deserialize<'de> for CompilationUnitwhere
'de: 'static,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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 ==.Source§impl Serialize for CompilationUnit
impl Serialize for CompilationUnit
Source§impl Walker for CompilationUnit
impl Walker for CompilationUnit
fn walk<V>(&self, visitor: &mut V)where
V: AstVisitor,
Source§impl WalkerMut for CompilationUnit
impl WalkerMut for CompilationUnit
fn walk<V>(&mut self, visitor: &mut V)where
V: AstVisitorMut,
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