zserio_rs_build

Struct Model

source
pub struct Model {
    pub packages: HashMap<String, ZPackage>,
    pub scope: ModelScope,
}
Expand description

A data structure containing all zserio files related to each other.

Fields§

§packages: HashMap<String, ZPackage>

All zserio packages.

§scope: ModelScope

An auto-generated symbol scope, which registers the paths of each symbol within packages.

Implementations§

source§

impl Model

source

pub fn from_filesystem(directory: &Path) -> Self

Loads a complete zserio model from a directory. It iterates over a directory, and parses all *.zs files, and loads them into a Model structure.

source

pub fn evaluate(&mut self)

Evaluates a zserio model by

  1. instantiating all templates.
  2. perform a type resolution and ensure that all types are correctly referenced.
  3. evaluate all expressions.

Currently, this function will panic if there is an error during any of the above steps.

source

pub fn resolve_types(&mut self)

source

pub fn instantiate_templates(&mut self)

source

pub fn evaluate_package(&mut self)

Auto Trait Implementations§

§

impl Freeze for Model

§

impl !RefUnwindSafe for Model

§

impl !Send for Model

§

impl !Sync for Model

§

impl Unpin for Model

§

impl !UnwindSafe for Model

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> AnyExt for T
where T: Any + ?Sized,

source§

fn downcast_ref<T>(this: &Self) -> Option<&T>
where T: Any,

Attempts to downcast this to T behind reference
source§

fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>
where T: Any,

Attempts to downcast this to T behind mutable reference
source§

fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>
where T: Any,

Attempts to downcast this to T behind Rc pointer
source§

fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>
where T: Any,

Attempts to downcast this to T behind Arc pointer
source§

fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>
where T: Any,

Attempts to downcast this to T behind Box pointer
source§

fn downcast_move<T>(this: Self) -> Option<T>
where T: Any, Self: Sized,

Attempts to downcast owned Self to T, useful only in generic context as a workaround for specialization
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, X> CoerceTo<T> for X
where T: CoerceFrom<X> + ?Sized,

source§

fn coerce_rc_to(self: Rc<X>) -> Rc<T>

source§

fn coerce_box_to(self: Box<X>) -> Box<T>

source§

fn coerce_ref_to(&self) -> &T

source§

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

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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.