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<(), Diagnostic>
pub fn check_pre_run(&self, steps: &[Step]) -> Result<(), Diagnostic>
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 moreAuto Trait Implementations§
impl<P> !RefUnwindSafe for HostModule<P>
impl<P> !UnwindSafe for HostModule<P>
impl<P> Forget for HostModule<P>
impl<P> Freeze for HostModule<P>
impl<P> Move for HostModule<P>
impl<P> Send for HostModule<P>
impl<P> Sync for HostModule<P>
impl<P> Unpin for HostModule<P>
impl<P> UnsafeUnpin for HostModule<P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.