Skip to main content

sim_lib_dispatch/
lib.rs

1#![forbid(unsafe_code)]
2#![deny(missing_docs)]
3//! Generic functions and method dispatch for the SIM runtime.
4//!
5//! The kernel defines the callable and operation contracts; this crate supplies
6//! the concrete dispatch organ (generic functions, multimethods, method
7//! specificity ordering).
8
9mod claims;
10mod generic;
11mod metaobject;
12mod method;
13mod runtime;
14
15/// Cookbook recipes for the dispatch organ, embedded at build time.
16pub static RECIPES: sim_cookbook::EmbeddedDir =
17    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
18
19pub use claims::{
20    dispatch_combine_op_key, dispatch_generic_op_key, dispatch_inspect_op_key,
21    dispatch_multimethod_op_key, dispatch_op_keys, dispatch_organ_symbol,
22    dispatch_specificity_op_key, publish_dispatch_organ_claims,
23    publish_dispatch_organ_claims_for_lib,
24};
25pub use generic::{GenericFunction, Multimethod};
26pub use metaobject::{MetaObjectProtocol, meta_index};
27pub use method::{DispatchMethod, MethodBody, MethodRole, MethodSpecificity, compare_specificity};
28pub use runtime::generic_function_value;
29
30#[cfg(test)]
31mod tests;