pub struct HostModule<P>where
P: ProcessManager,{
pub name: String,
pub funcs: Vec<HostRegistration<P>>,
pub types: Vec<&'static TypeDescriptor>,
pub record_schemas: Vec<RecordSchema>,
pub states: Vec<ModuleState>,
}Expand description
One host library: functions and types registered under a single module
name. Engine::register_module stages these; runs expose them as
MODULE::NAME calls with MODULE provenance on every entry.
Fields§
§name: String§funcs: Vec<HostRegistration<P>>§types: Vec<&'static TypeDescriptor>§record_schemas: Vec<RecordSchema>§states: Vec<ModuleState>Shared module state (endpoint registries and the like), stashed
at registration and reachable from bodies through
StepCtx::module_state. Lets every entry stay #[oxdock_func]:
the macro only generates closers-over-nothing, so state that
cannot ride in a value travels here instead of a hand-built
closure. Prefer .with_state(...) over spelling this field.
Implementations§
Source§impl<P> HostModule<P>where
P: ProcessManager,
impl<P> HostModule<P>where
P: ProcessManager,
Sourcepub fn with_state<T>(self, state: Arc<T>) -> HostModule<P>
pub fn with_state<T>(self, state: Arc<T>) -> HostModule<P>
Attach shared state for bodies to fetch with
cx.module_state::<T>("MODULE"). Chainable, like registration.
Sourcepub fn check_pre_run(&self, steps: &[Step]) -> Result<(), Error>
pub fn check_pre_run(&self, steps: &[Step]) -> Result<(), Error>
Run every staged PreRunCheck against already-parsed steps.
The runner calls this before the first step executes; the first
failing check aborts the run with no side effects.
Trait Implementations§
Source§impl<P> Clone for HostModule<P>where
P: Clone + ProcessManager,
impl<P> Clone for HostModule<P>where
P: Clone + ProcessManager,
Source§fn clone(&self) -> HostModule<P>
fn clone(&self) -> HostModule<P>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more