pub struct RulesHost<P: RulesProvider> {
pub compiled: CompiledRuleset,
pub bindings: P::Bindings,
}Expand description
A &'static bundle of the compiled registry + binding the zero-capture
interpret fn reaches without capturing (doc 11 §2.2).
A game installs one once (e.g. in a OnceLock) and returns it from
RulesProvider::rules_host.
Fields§
§compiled: CompiledRulesetThe compiled side registry.
bindings: P::BindingsThe game binding.
Implementations§
Source§impl<P: RulesProvider> RulesHost<P>
impl<P: RulesProvider> RulesHost<P>
Sourcepub fn new(compiled: CompiledRuleset, bindings: P::Bindings) -> Self
pub fn new(compiled: CompiledRuleset, bindings: P::Bindings) -> Self
Bundle a compiled registry + binding.
Sourcepub fn hook(&self, id: EffectId) -> Option<&CompiledHook>
pub fn hook(&self, id: EffectId) -> Option<&CompiledHook>
The compiled hook for an EffectId.
Auto Trait Implementations§
impl<P> Freeze for RulesHost<P>
impl<P> RefUnwindSafe for RulesHost<P>
impl<P> Send for RulesHost<P>
impl<P> Sync for RulesHost<P>
impl<P> Unpin for RulesHost<P>
impl<P> UnsafeUnpin for RulesHost<P>
impl<P> UnwindSafe for RulesHost<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
Mutably borrows from an owned value. Read more