retrace_frontend/viewer
Default replay UI with replaceable typed data sources. Browser target only. Mount supplies scoped default styles; override them in your application’s stylesheet to customize presentation. Replay remains application-owned.
Types
pub type Artifact {
Artifact(build: String, url: String, development: Bool)
}
Constructors
-
Artifact(build: String, url: String, development: Bool)
pub type Config {
Config(
source: Source,
artifacts: fn(wire.Session) -> fn(
fn(Result(Artifact, String)) -> Nil,
) -> fn() -> Nil,
max_entries: Int,
label_event: fn(EventLabel) -> String,
)
}
Constructors
-
Config( source: Source, artifacts: fn(wire.Session) -> fn( fn(Result(Artifact, String)) -> Nil, ) -> fn() -> Nil, max_entries: Int, label_event: fn(EventLabel) -> String, )
pub type EventLabel {
EventLabel(
sequence: Int,
elapsed_ms: Int,
kind: String,
label: String,
)
}
Constructors
-
EventLabel( sequence: Int, elapsed_ms: Int, kind: String, label: String, )
pub type Page {
Page(batches: List(String), next: option.Option(Int))
}
Constructors
-
Page(batches: List(String), next: option.Option(Int))
pub type Resolver =
fn(wire.Session) -> fn(fn(Result(Artifact, String)) -> Nil) -> fn(
,
) -> Nil
pub type Summary {
Summary(session: wire.Session, sequence: Int)
}
Constructors
-
Summary(session: wire.Session, sequence: Int)
Values
pub fn artifacts(
directory: String,
) -> fn(wire.Session) -> fn(fn(Result(Artifact, String)) -> Nil) -> fn(
,
) -> Nil
Resolve /
pub fn collector(endpoint: String) -> Source
HTTP routes matching retrace_server’s example collector, with a ten-second request deadline. Session search is bounded to the collector’s first page.
pub fn mount(
config: Config,
selector: String,
) -> Result(fn() -> Nil, String)
Mount owns DOM, playback clock and requests. Dispose before replacing the host. The disposer is idempotent. Artifacts must share the viewer’s origin.
pub fn new(
source: Source,
artifacts: fn(wire.Session) -> fn(
fn(Result(Artifact, String)) -> Nil,
) -> fn() -> Nil,
) -> Config
pub fn with_development(
resolver: fn(wire.Session) -> fn(
fn(Result(Artifact, String)) -> Nil,
) -> fn() -> Nil,
build: String,
contract: String,
url: String,
) -> fn(wire.Session) -> fn(fn(Result(Artifact, String)) -> Nil) -> fn(
,
) -> Nil
Explicit mutable development override; all other builds use the resolver.