pub struct PaintEnvelope {
pub engine: EngineId,
pub viewport: DeviceIntSize,
pub generation: u64,
pub commands: Vec<PaintCmd>,
pub fonts: Vec<FontResource>,
pub images: Vec<ImageResource>,
}Expand description
Wire shape for transporting a PaintList across IPC, fixture
files, or any boundary where the producer’s concrete PaintList
impl can’t be carried by name. PM-3 doc proposed
enum { Genet(GenetPaintList), Nematic(...), Scrying(...) };
implementation went with a flat struct + EngineId discriminant
because none of the concrete impls carry engine-specific extra
fields beyond what the trait already exposes, and the enum shape
would force paint-api to depend on every engine crate.
Same closed-set property as the doc’s enum (EngineId is closed),
without the dep inversion. If a future engine grows truly
engine-specific transport fields, switch to the enum then.
Fields§
§engine: EngineIdWhich engine produced this. Receivers route on this discriminant.
viewport: DeviceIntSizeViewport the commands were computed against.
generation: u64Producer-rolled semantic-equivalence epoch. Same value asserts identical paint output across resends.
commands: Vec<PaintCmd>Paint command stream in paint order.
fonts: Vec<FontResource>Font resources referenced by DrawText commands. See
FontResource.
images: Vec<ImageResource>Image resources referenced by DrawImage /
DrawRepeatingImage commands. See ImageResource.
Implementations§
Source§impl PaintEnvelope
impl PaintEnvelope
Sourcepub fn from_list<L: PaintList>(list: &L) -> Self
pub fn from_list<L: PaintList>(list: &L) -> Self
Package any PaintList impl into the wire form. Clones the
command + font slices — the envelope owns its payload once
constructed. Callers that need zero-copy transport can build
the envelope manually with Vec::from/Cow patterns as
usage shapes emerge.
Trait Implementations§
Source§impl Clone for PaintEnvelope
impl Clone for PaintEnvelope
Source§fn clone(&self) -> PaintEnvelope
fn clone(&self) -> PaintEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PaintEnvelope
impl Debug for PaintEnvelope
Source§impl<'de> Deserialize<'de> for PaintEnvelope
impl<'de> Deserialize<'de> for PaintEnvelope
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PaintList for PaintEnvelope
impl PaintList for PaintEnvelope
Source§fn engine_id(&self) -> EngineId
fn engine_id(&self) -> EngineId
&L: PaintList. The trait is not
dyn-compatible (the supertrait bounds aren’t object-safe) —
engine-agnostic code dispatches on the envelope, not on a
trait object.Source§fn viewport(&self) -> DeviceIntSize
fn viewport(&self) -> DeviceIntSize
Source§fn generation_id(&self) -> u64
fn generation_id(&self) -> u64
(source_id, generation_id) asserts identical paint output and
resource references; the renderer may use this to skip relowering
(PaintList → Scene). Not a tile-cache invalidation key —
tile-cache correctness still derives from SceneOp content
hashing post-lowering.Source§fn commands(&self) -> &[PaintCmd]
fn commands(&self) -> &[PaintCmd]
Source§fn fonts(&self) -> &[FontResource]
fn fonts(&self) -> &[FontResource]
DrawText commands in this list.
Each FontResource carries the font bytes + the
FontInstanceKey that TextRunItem::font_instance points at;
the renderer registers these into its font palette and resolves
each text run’s key to a concrete font. Default is empty — only
lists that emit text populate it.Source§fn images(&self) -> &[ImageResource]
fn images(&self) -> &[ImageResource]
DrawImage / DrawRepeatingImage
commands. Each ImageResource carries decoded RGBA8 pixels +
the ImageKey that ImageItem::image_key points at; the
renderer registers these into its image atlas and resolves each
image item’s key to a concrete texture. Default is empty.