retrace_frontend/replay
Optional replay composition. Application-native types stay inside the artifact.
Types
pub type Error(error) {
InvalidRange(String)
InvalidReplay(retrace.Error(error))
}
Constructors
-
InvalidRange(String) -
InvalidReplay(retrace.Error(error))
The dimensions, in CSS pixels, that size the replay frame for one snapshot.
The live observation is retrace_frontend/viewport.Viewport.
pub type FrameSize {
FrameSize(width: Int, height: Int)
}
Constructors
-
FrameSize(width: Int, height: Int)
pub type ReplayModule(model, message, error) {
ReplayModule(
contract: String,
decode_model: fn(String) -> Result(model, String),
decode_event: fn(wire.Event) -> Result(message, String),
reduce: fn(model, message) -> Result(model, error),
equal: fn(model, model) -> Bool,
view: fn(model) -> element.Element(message),
frame_size: fn(model) -> FrameSize,
label: fn(wire.Event) -> String,
)
}
Constructors
-
ReplayModule( contract: String, decode_model: fn(String) -> Result(model, String), decode_event: fn(wire.Event) -> Result(message, String), reduce: fn(model, message) -> Result(model, error), equal: fn(model, model) -> Bool, view: fn(model) -> element.Element(message), frame_size: fn(model) -> FrameSize, label: fn(wire.Event) -> String, )
Values
pub fn describe(
app: ReplayModule(model, message, error),
snapshots: List(Snapshot(model)),
) -> String
pub fn load(
app: ReplayModule(model, message, error),
batches: List(wire.Batch),
build: String,
max_entries: Int,
) -> Result(List(Snapshot(model)), Error(error))
Loads a checkpoint plus contiguous entries; no effects are executed. A failed load returns no partially validated snapshots.
pub fn mount(
app: ReplayModule(model, message, error),
build: String,
selector: String,
max_entries: Int,
) -> Result(fn() -> Nil, lustre.Error)
Mount one trusted same-origin frame. Call the returned function to stop it. The host owns element lifetime; effects and live capture never run here.
pub fn mount_with_parent_origin(
app: ReplayModule(model, message, error),
build: String,
selector: String,
max_entries: Int,
trusted_parent_origin: String,
) -> Result(fn() -> Nil, String)
Mount an opaque sandbox frame for an explicitly trusted HTTP(S) parent. Parent configuration must come from the trusted artifact assembler, never a recording, query parameter, referrer, or message. The viewer supplies the channel nonce through the iframe name before assigning its srcdoc document.