Trait reproto_manifest::Lang
[−]
[src]
pub trait Lang: Debug { fn copy(&self) -> Box<Lang>; fn module_specs(
&self,
path: &Path,
input: Option<Value>
) -> Result<Vec<Box<Any>>>; fn string_spec(&self, path: &Path, input: &str) -> Result<Box<Any>>; fn compile(
&self,
ctx: Rc<Context>,
env: Environment<CoreFlavor>,
manifest: Manifest
) -> Result<()>; fn comment(&self, _input: &str) -> Option<String> { ... } fn keywords(&self) -> Vec<(&'static str, &'static str)> { ... } fn safe_packages(&self) -> bool { ... } fn into_env(
&self,
ctx: Rc<Context>,
package_prefix: Option<RpPackage>,
resolver: Box<Resolver>
) -> Environment<CoreFlavor> { ... } fn package_naming(&self) -> Option<Box<Naming>> { ... } fn field_ident_naming(&self) -> Option<Box<Naming>> { ... } fn endpoint_ident_naming(&self) -> Option<Box<Naming>> { ... } }
The trait that describes the specific implementation of a given language.
TODO: move language-specific integrations into own crate. Options would have to be transferred to a local type.
Required Methods
fn copy(&self) -> Box<Lang>
Copy self.
Implemented through lang_base!
macro.
fn module_specs(
&self,
path: &Path,
input: Option<Value>
) -> Result<Vec<Box<Any>>>
&self,
path: &Path,
input: Option<Value>
) -> Result<Vec<Box<Any>>>
Parse a complex set of module configurations.
Implemented through lang_base!
macro.
fn string_spec(&self, path: &Path, input: &str) -> Result<Box<Any>>
Parse a module configuration consisting of only a string.
Implemented through lang_base!
macro.
fn compile(
&self,
ctx: Rc<Context>,
env: Environment<CoreFlavor>,
manifest: Manifest
) -> Result<()>
&self,
ctx: Rc<Context>,
env: Environment<CoreFlavor>,
manifest: Manifest
) -> Result<()>
Language-specific compile hook.
Implemented through lang_base!
macro.
Provided Methods
fn comment(&self, _input: &str) -> Option<String>
Comment the given string.
fn keywords(&self) -> Vec<(&'static str, &'static str)>
Get a list of keywords to transliterate.
fn safe_packages(&self) -> bool
Indicates if the language requires keyword-escaping in the packages.
fn into_env(
&self,
ctx: Rc<Context>,
package_prefix: Option<RpPackage>,
resolver: Box<Resolver>
) -> Environment<CoreFlavor>
&self,
ctx: Rc<Context>,
package_prefix: Option<RpPackage>,
resolver: Box<Resolver>
) -> Environment<CoreFlavor>
Helper to convert into environment.
fn package_naming(&self) -> Option<Box<Naming>>
Rename packages according to the given naming convention.
fn field_ident_naming(&self) -> Option<Box<Naming>>
Rename fields according to the given naming convention.
fn endpoint_ident_naming(&self) -> Option<Box<Naming>>
Rename endpoint identifiers according to the given naming convention.
Implementors
impl Lang for NoLang