Skip to main content

Module registry

Module registry 

Source
Expand description

Global inventory-collected registry for custom ops. Global registries collected via inventory.

lives in bb_ir::registry (foundation, shared by bb-dsl and bb-runtime). This module re-exports it and adds the custom-op registry, which depends on runtime-side types (RuntimeResourceRef, OpError, DispatchResult) and therefore stays alongside the engine.

See the module-level docs in bb_ir::registry for the concrete-component half’s authoring patterns. The custom-op registry follows the same inventory::submit! pattern; the bb::register_op!{} declarative macro emits the submission for library makers.

Modules§

inventory
githubcrates-iodocs-rs

Structs§

BootstrapDispatcherRegistration
Per-concrete inventory carrying a per-T Bootstrap dispatcher- registration fn pointer. The #[derive(bb::Concrete)] macro emits one of these per registered concrete so the install path can register every concrete’s Bootstrap dispatcher without the per-T downcast. Pairs with crate::engine::Engine::register_bootstrap_dispatcher.
ComponentRoleBinding
Per-(component_type, role) inventory entry: each #[derive(bb::<Role>)] proc-macro emits one of these alongside the universal triple. Node::ensure_ready walks the channel + joins by type_name to compute the role bitflags per concrete component.
ConcreteComponentRegistration
Inventory entry for a concrete component, keyed by TYPE_NAME.
DependencyDecl
Author-declared sibling dependency at a named slot. Compiler verifies role match; runtime reaches it via RuntimeResourceRef::dependency::<T>(slot).
DispatcherRegistration
Per-(component_type, role) inventory carrying a per-T dispatcher-registration fn pointer. Each role derive emits one of these alongside ComponentRoleBinding; install() walks the channel + calls register_fn(engine) for each bound concrete so the engine learns about every role dispatcher without the install path needing the typed &T.
OpRegistration
Single inventory entry covering every op the framework dispatches. Library makers ship via bb::register_op!; bb-ops’s syscalls submit directly. Engine dispatch keys on (domain, op_type) — no TypeId lookup.
StorageTypeEntry
Per-concrete Storage-type entry registered by #[derive(bb::<Role>)].

Enums§

ComponentRole
One concrete framework role a component declares.
RegistrationKind
User-custom vs framework-syscall discriminator on OpRegistration. Iterators surface entries filtered by kind.

Functions§

bootstrap_dispatcher_for
Look up the Bootstrap dispatcher-registration fn for type_name. install() calls this for every registered concrete so the Component bootstrap fire path can dispatch through the right impl. Returns None when the concrete was registered without the #[derive(bb::Concrete)] Bootstrap-bridge emission.
concrete_components
Iterate every concrete-component registration this binary links.
dispatcher_for
Look up the dispatcher-registration fn for (type_name, role). install() calls this for every binding in the artifact’s BindingSpec. Returns None when the role derive isn’t present in this binary’s inventory (e.g. a hand-implemented role trait without the derive).
find_concrete_component
Look up a concrete by TYPE_NAME. None when unregistered in this binary.
find_op
Look up a Custom-kind op by its (domain, op_type) key. Used by the engine’s dispatch fallback for user-shipped ops outside the role surface.
framework_syscalls
Iterate every Syscall-kind registration. Consumed by Engine::register_all_framework_syscalls at Node construction time.
iter_storage_types
Iterate every registered Storage-type entry in this binary.
lookup_storage_type
Look up the TypeNode for a specific (concrete_type_name, role_runtime, port) triple.
ops
Iterate every Custom-kind op registration this binary links in.
roles_for_component
Iterate every role binding for a given component type. Used by Node::ensure_ready to compute the bitflags + by introspection tools to discover what roles a struct implements.

Type Aliases§

OpInvokeFn
Type-erased dispatch fn for any op (custom OR syscall).