Struct reproto_trans::environment::Environment
[−]
[src]
pub struct Environment<F: 'static> where
F: Flavor, { /* fields omitted */ }
Scoped environment for evaluating reproto IDLs.
Methods
impl<F: 'static> Environment<F> where
F: Flavor,
[src]
F: Flavor,
Environment containing all loaded declarations.
pub fn new(
ctx: Rc<Context>,
package_prefix: Option<RpPackage>,
resolver: Box<Resolver>
) -> Environment<F>
[src]
ctx: Rc<Context>,
package_prefix: Option<RpPackage>,
resolver: Box<Resolver>
) -> Environment<F>
Construct a new, language-neutral environment.
pub fn with_path_hook<H: 'static>(self, path_hook: H) -> Self where
H: Fn(&Path) -> Result<()>,
[src]
H: Fn(&Path) -> Result<()>,
Setup a new path hook for this 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 with_endpoint_ident_naming(
self,
endpoint_ident_naming: Box<Naming>
) -> Self
[src]
self,
endpoint_ident_naming: Box<Naming>
) -> Self
Set endpoint ident naming.
impl Environment<CoreFlavor>
[src]
pub fn translator<T: 'static>(&self, flavor: T) -> Result<Context<T>> where
T: FlavorTranslator<Source = CoreFlavor>,
[src]
T: FlavorTranslator<Source = CoreFlavor>,
Build a new translator.
pub fn translate<T>(self, ctx: Context<T>) -> Result<Translated<T::Target>> where
T: FlavorTranslator<Source = CoreFlavor>,
[src]
T: FlavorTranslator<Source = CoreFlavor>,
Translate the current environment into another.
pub fn packages(&self) -> Result<Rc<Packages>>
[src]
Translation to simplified packages.
pub fn translate_default(self) -> Result<Translated<CoreFlavor>>
[src]
Translate without changing the flavor.
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_source(
&mut self,
object: &Source,
package: Option<RpVersionedPackage>
) -> Result<RpVersionedPackage>
[src]
&mut self,
object: &Source,
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.
pub fn load_object(
&mut self,
object: &Source,
package: &RpVersionedPackage
) -> Result<RpFile<CoreFlavor>>
[src]
&mut self,
object: &Source,
package: &RpVersionedPackage
) -> Result<RpFile<CoreFlavor>>
Load the provided Source into an RpFile
without registering it to the set of visited
files.