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
impl Model
sourcepub fn from_filesystem(directory: &Path) -> Self
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.
sourcepub fn evaluate(&mut self)
pub fn evaluate(&mut self)
Evaluates a zserio model by
- instantiating all templates.
- perform a type resolution and ensure that all types are correctly referenced.
- evaluate all expressions.
Currently, this function will panic if there is an error during any of the above steps.
pub fn resolve_types(&mut self)
pub fn instantiate_templates(&mut self)
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> AnyExt for T
impl<T> AnyExt for T
source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T
behind referencesource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T
behind mutable referencesource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T
behind Rc
pointersource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T
behind Arc
pointersource§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
source§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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