Struct reproto_trans::environment::Environment
[−]
[src]
pub struct Environment { /* fields omitted */ }
Scoped environment for evaluating reproto IDLs.
Methods
impl Environment
[src]
Environment containing all loaded declarations.
pub fn new(
ctx: Rc<Context>,
package_prefix: Option<RpPackage>,
resolver: Box<Resolver>
) -> Environment
[src]
ctx: Rc<Context>,
package_prefix: Option<RpPackage>,
resolver: Box<Resolver>
) -> Environment
Construct a new, language-neutral environment.
pub fn with_safe_packages(self, safe_packages: bool) -> Self
[src]
Configure a new environment on how to use safe packages or not.
pub fn with_keywords(self, keywords: HashMap<String, String>) -> Self
[src]
Build the environment with the given keywords.
pub fn with_package_naming(self, package_naming: Box<Naming>) -> Self
[src]
Set package naming policy.
pub fn with_field_ident_naming(self, field_ident_naming: Box<Naming>) -> Self
[src]
Set field naming policy.
pub fn lookup<'a>(&'a self, name: &RpName) -> Result<&'a RpReg>
[src]
Lookup the declaration matching the given name.
Returns the registered reference, if present.
pub fn import_path<P: AsRef<Path>>(
&mut self,
path: P,
package: Option<RpVersionedPackage>
) -> Result<RpVersionedPackage>
[src]
&mut self,
path: P,
package: Option<RpVersionedPackage>
) -> Result<RpVersionedPackage>
Import a path into the environment.
pub fn import_object(
&mut self,
object: &Object,
package: Option<RpVersionedPackage>
) -> Result<RpVersionedPackage>
[src]
&mut self,
object: &Object,
package: Option<RpVersionedPackage>
) -> Result<RpVersionedPackage>
Import an object into the environment.
pub fn import_file(
&mut self,
file: File,
package: Option<RpVersionedPackage>
) -> Result<RpVersionedPackage>
[src]
&mut self,
file: File,
package: Option<RpVersionedPackage>
) -> Result<RpVersionedPackage>
Import a single, structured file object.
pub fn import(
&mut self,
required: &RpRequiredPackage
) -> Result<Option<RpVersionedPackage>>
[src]
&mut self,
required: &RpRequiredPackage
) -> Result<Option<RpVersionedPackage>>
Import a package based on a package and version criteria.
pub fn verify(&mut self) -> Result<()>
[src]
Verify all declarations.
ⓘImportant traits for ForEachFile<'a>pub fn for_each_file(&self) -> ForEachFile
[src]
Iterate over all files.
ⓘImportant traits for ToplevelDeclIter<'a>pub fn toplevel_decl_iter(&self) -> ToplevelDeclIter
[src]
Iterate over top level declarations of all registered objects.
ⓘImportant traits for DeclIter<'a>pub fn decl_iter(&self) -> DeclIter
[src]
Walks the entire tree of declarations recursively of all registered objects.
pub fn load_object(
&mut self,
object: &Object,
package: &RpVersionedPackage
) -> Result<RpFile>
[src]
&mut self,
object: &Object,
package: &RpVersionedPackage
) -> Result<RpFile>
Load the provided Object into an RpFile
without registering it to the set of visited
files.