1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Local message delivery facility.
//!
//! The Send opcode resolves a target PID but, for a cross-process local send,
//! does not hold the receiver process body — that body lives in the scheduler's
//! `process_bodies` map. [`LocalSendFacility`] is the scheduler-implemented
//! bridge that locks the target slot and delivers the message using the exact
//! lock-slot / Present-Executing-Absent / push-before-wake template the I/O
//! delivery paths already use.
//!
//! The facility mirrors
//! [`DistributionSendFacility`](crate::distribution::control::DistributionSendFacility):
//! a trait named in the interpreter and implemented in the scheduler crate.
use ;
use crateReplayDriver;
use crateTerm;
/// Error returned by [`LocalSendFacility::send_local`].
///
/// A dead/absent target is NOT an error — it is a silent drop, matching BEAM
/// semantics. The only failure surface is a replay-determinism mismatch, which
/// the caller maps to [`ExecError::ReplayMismatch`](crate::error::ExecError).
/// Synchronous request to deliver one message to a local target process.
///
/// The `message` term references the *sender's* heap. The call is synchronous,
/// performed inside the sender's slice while the sender body is alive, so the
/// facility may read/encode the term during the call. The facility MUST NOT
/// store the raw term past the call: the `Present` branch copies it into the
/// receiver heap immediately; the `Executing` branch ETF-encodes it to bytes
/// immediately.
/// Delivers a local message term to a live target process body held by the
/// scheduler.
///
/// Returns `Ok(())` whether or not the target exists (a dead/absent pid is a
/// silent drop, matching BEAM semantics); `Err` only for a genuine
/// replay-determinism mismatch.