pub struct Registry { /* private fields */ }Expand description
Everything known about who proves what.
Implementations§
Source§impl Registry
impl Registry
Sourcepub fn add_environment(
&mut self,
environment: Environment,
) -> Result<(), RegistryError>
pub fn add_environment( &mut self, environment: Environment, ) -> Result<(), RegistryError>
Introduces a place implementations can run.
Sourcepub fn register(
&mut self,
implementation: Implementation,
) -> Result<(), RegistryError>
pub fn register( &mut self, implementation: Implementation, ) -> Result<(), RegistryError>
Records that something proves a proposition.
Sourcepub fn register_native<F, Fut>(&mut self, entry: &str, f: F)
pub fn register_native<F, Fut>(&mut self, entry: &str, f: F)
Registers a function compiled into this process, under an entry name that an implementation can point at.
This is a module registering itself as an execution source, in the case where the module happens to be linked in.
Sourcepub fn register_native_sync<F>(&mut self, entry: &str, f: F)
pub fn register_native_sync<F>(&mut self, entry: &str, f: F)
The same, for a function that does not need to wait for anything.
Sourcepub fn register_bodies(
&mut self,
ws: &CheckedWorkspace,
) -> Result<usize, RegistryError>
pub fn register_bodies( &mut self, ws: &CheckedWorkspace, ) -> Result<usize, RegistryError>
Registers every signature that carries its own proof.
A body is an implementation already: it needs no environment beyond this process and no one to write it. Derived bridges arrive this way.
Sourcepub fn load_manifest(
&mut self,
text: &str,
base: &Path,
) -> Result<usize, RegistryError>
pub fn load_manifest( &mut self, text: &str, base: &Path, ) -> Result<usize, RegistryError>
Takes in a module’s declaration of what it can prove.
Relative paths inside are resolved against base, which is the
directory the declaration came from, so that a manifest means the same
thing wherever it is loaded from.
Sourcepub fn load_manifest_file(
&mut self,
path: &Path,
) -> Result<usize, RegistryError>
pub fn load_manifest_file( &mut self, path: &Path, ) -> Result<usize, RegistryError>
Reads a manifest from a file.
Sourcepub fn proofs_of(&self, sig: &QualifiedName) -> Vec<&Implementation>
pub fn proofs_of(&self, sig: &QualifiedName) -> Vec<&Implementation>
Everything that claims to prove a proposition, in registration order.
Sourcepub fn implementation(&self, id: &ImplId) -> Option<&Implementation>
pub fn implementation(&self, id: &ImplId) -> Option<&Implementation>
One implementation, by name.
Sourcepub fn implementations(&self) -> &[Implementation]
pub fn implementations(&self) -> &[Implementation]
Every implementation, in registration order.
Sourcepub fn environment(&self, id: &Ident) -> Option<&Environment>
pub fn environment(&self, id: &Ident) -> Option<&Environment>
One environment, by name.
Sourcepub fn environments(&self) -> impl Iterator<Item = &Environment>
pub fn environments(&self) -> impl Iterator<Item = &Environment>
Every environment, by name.
Sourcepub fn native(&self, entry: &str) -> Option<&NativeFn>
pub fn native(&self, entry: &str) -> Option<&NativeFn>
A function compiled into this process, by entry name.
Sourcepub fn check_against(&self, ws: &CheckedWorkspace) -> Vec<RegistryWarning>
pub fn check_against(&self, ws: &CheckedWorkspace) -> Vec<RegistryWarning>
Checks what is registered against what the workspace actually declares.
Catches the two ways a registry drifts: an implementation proving something nobody declares, and one written against a proposition that has since changed out from under it.