orinium_browser/engine/port/mod.rs
1//! Ports for moving work between threads, and later between processes.
2//!
3//! The browser currently runs everything in one process, so "where does this
4//! code run" is answered by a thread id and nothing else. That answer stops
5//! working the moment a component is split out: a call that used to be a
6//! function call becomes a message, and the code that sends it has to stop
7//! assuming the callee shares its memory.
8//!
9//! [`Outbox`] and [`Mailbox`] are the two ends of a one-way channel; the
10//! [`Transport`] between them decides where the messages actually travel. All
11//! three are plain values, so a caller keeps working whether the far end is
12//! another thread in this process or a peer in another one.
13//!
14//! The scope is deliberately narrow. This is a *placement* port, not a
15//! serialisation port: nothing here decides how a message is encoded, and a
16//! cross-process transport will additionally need `Serialize`/`Deserialize` on
17//! the message types. Some engine types cannot cross that boundary at all yet
18//! — see [`SendableResult`](crate::engine::layouter::processor) and the `Rc` in
19//! DOM trees.
20
21pub mod mailbox;
22pub mod transport;
23
24pub use mailbox::{Consume, Disconnected, Mailbox, Outbox, Produce, Undeliverable};
25pub use transport::{InProcess, Transport};