Struct reproto_backend::Environment
[−]
[src]
pub struct Environment { /* fields omitted */ }
Scoped environment for evaluating ReProto IDLs.
Methods
impl Environment
[src]
Environment containing all loaded declarations.
fn new(
package_prefix: Option<RpPackage>,
resolver: Box<Resolver>
) -> Environment
[src]
package_prefix: Option<RpPackage>,
resolver: Box<Resolver>
) -> Environment
fn is_assignable_from(
&self,
package: &RpVersionedPackage,
target: &RpType,
source: &RpType
) -> Result<bool>
[src]
&self,
package: &RpVersionedPackage,
target: &RpType,
source: &RpType
) -> Result<bool>
Check if source is assignable to target.
fn lookup<'a>(&'a self, name: &RpName) -> Result<&'a RpRegistered>
[src]
Lookup the declaration matching the given name.
Returns the registered reference, if present.
fn load_object<O: Into<Box<Object>>>(
&mut self,
object: O,
version: Option<Version>,
package: RpPackage
) -> Result<Option<(RpVersionedPackage, RpFile)>>
[src]
&mut self,
object: O,
version: Option<Version>,
package: RpPackage
) -> Result<Option<(RpVersionedPackage, RpFile)>>
Load the provided Object into a RpFile
and identify which package and version it belongs
to.
fn process_uses(
&mut self,
uses: &[Loc<UseDecl>]
) -> Result<HashMap<String, RpVersionedPackage>>
[src]
&mut self,
uses: &[Loc<UseDecl>]
) -> Result<HashMap<String, RpVersionedPackage>>
Process use declarations found at the top of each object.
fn for_each_toplevel_decl<O>(&self, op: O) -> Result<()> where
O: FnMut(Rc<Loc<RpDecl>>) -> Result<()>,
[src]
O: FnMut(Rc<Loc<RpDecl>>) -> Result<()>,
Iterate over top level declarations of all registered objects.
fn for_each_decl<'a, O>(&'a self, op: O) -> Result<()> where
O: FnMut(&'a Rc<Loc<RpDecl>>) -> Result<()>,
[src]
O: FnMut(&'a Rc<Loc<RpDecl>>) -> Result<()>,
Walks the entire tree of declarations recursively of all registered objects.
fn process_decls<I>(
&self,
input: I
) -> Result<LinkedHashMap<RpName, Rc<Loc<RpDecl>>>> where
I: IntoIterator<Item = Loc<RpDecl>>,
[src]
&self,
input: I
) -> Result<LinkedHashMap<RpName, Rc<Loc<RpDecl>>>> where
I: IntoIterator<Item = Loc<RpDecl>>,
Process, register, and merge declarations.
Declarations are considered the same if they have the same qualified name.
The same declarations are merged using Merge
.
fn process_types<'a, I: 'a>(
&mut self,
decls: I
) -> Result<LinkedHashMap<RpName, RpRegistered>> where
I: IntoIterator<Item = &'a Rc<Loc<RpDecl>>>,
[src]
&mut self,
decls: I
) -> Result<LinkedHashMap<RpName, RpRegistered>> where
I: IntoIterator<Item = &'a Rc<Loc<RpDecl>>>,
Process all declarations and convert into a global collection of registered types.
fn process_file(&mut self, file: RpFile) -> Result<()>
[src]
fn import_file<P: AsRef<Path>>(
&mut self,
path: P
) -> Result<Option<RpVersionedPackage>>
[src]
&mut self,
path: P
) -> Result<Option<RpVersionedPackage>>
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.
fn verify(&mut self) -> Result<()>
[src]
Verify all declarations.