Skip to main content

Interaction

Trait Interaction 

pub trait Interaction:
    Send
    + Sync
    + 'static {
    // Required methods
    fn decide(&self, host: &dyn Host, input: &CauldronUse) -> CauldronDecision;
    fn fire(
        &self,
        host: &mut dyn ServerHost,
        input: &CauldronUse,
        plan: &CauldronPlan,
    ) -> CauldronFire;
}
Expand description

NeoForge’s documented RegisterCauldronInteractionEvent.Interaction counterpart. Uses the shared transaction and runtime limits; no cauldron-specific budget. Custom handlers are server-only: clients suppress prediction and wait for the server result. Vanilla handlers still predict locally. Matching custom builds and resource generations are not established by the current handshake.

Required Methods§

fn decide(&self, host: &dyn Host, input: &CauldronUse) -> CauldronDecision

Decide through read-only host access on either side, without authoritative writes.

fn fire( &self, host: &mut dyn ServerHost, input: &CauldronUse, plan: &CauldronPlan, ) -> CauldronFire

Additional server writes run inside the existing action savepoint.

Trait Implementations§

§

impl Wire for Box<dyn Interaction>

§

const MIN: usize = 8

Minimum encoded size, used to reject impossible collection lengths.
§

fn put(&self, out: &mut Writer)

Encodes this value, recording failures on the writer.
§

fn put_owned(self, out: &mut Writer)

Consumes owned data when a resource’s ownership must cross the boundary.
§

fn take(input: &mut Reader<'_>) -> Result<Box<dyn Interaction>, WireError>

Decodes one value, leaving any following bytes for the caller.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§