Skip to main content

sim_lib_dispatch/
lib.rs

1#![forbid(unsafe_code)]
2#![deny(missing_docs)]
3//! Generic functions, method dispatch, and neutral property mechanics for the
4//! SIM runtime.
5//!
6//! The kernel defines the callable and operation contracts; this crate supplies
7//! the concrete dispatch organ (generic functions, multimethods, method
8//! specificity ordering). It also owns ordered own-property storage and
9//! bounded receiver-aware descriptor execution while leaving traversal order
10//! and precedence to language profiles.
11
12mod claims;
13mod generic;
14mod metaobject;
15mod method;
16mod property;
17mod runtime;
18
19/// Cookbook recipes for the dispatch organ, embedded at build time.
20pub static RECIPES: sim_cookbook::EmbeddedDir =
21    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
22
23pub use claims::{
24    dispatch_combine_op_key, dispatch_generic_op_key, dispatch_inspect_op_key,
25    dispatch_multimethod_op_key, dispatch_op_keys, dispatch_organ_symbol,
26    dispatch_specificity_op_key, publish_dispatch_organ_claims,
27    publish_dispatch_organ_claims_for_lib,
28};
29pub use generic::{GenericFunction, Multimethod};
30pub use metaobject::{MetaObjectProtocol, meta_index};
31pub use method::{DispatchMethod, MethodBody, MethodRole, MethodSpecificity, compare_specificity};
32pub use property::{
33    AccessContext, AccessError, AccessKind, AccessorDescriptor, DataDescriptor, DefineError,
34    Descriptor, PropertyHook, PropertyStore,
35};
36pub use runtime::generic_function_value;
37
38#[cfg(test)]
39mod property_tests;
40#[cfg(test)]
41mod tests;