Skip to main content

CompilationUnit

Struct CompilationUnit 

Source
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: LinkageType

Implementations§

Source§

impl CompilationUnit

Source

pub fn new(file_name: &'static str) -> Self

Source

pub fn with_implementations(self, implementations: Vec<Implementation>) -> Self

Source

pub fn with_linkage(self, linkage: LinkageType) -> Self

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CompilationUnit
where 'de: 'static,

Source§

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

Source§

fn eq(&self, other: &CompilationUnit) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CompilationUnit

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Walker for CompilationUnit

Source§

fn walk<V>(&self, visitor: &mut V)
where V: AstVisitor,

Source§

impl WalkerMut for CompilationUnit

Source§

fn walk<V>(&mut self, visitor: &mut V)
where V: AstVisitorMut,

Source§

impl StructuralPartialEq for CompilationUnit

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,