Skip to main content

serve_memory

Function serve_memory 

Source
pub fn serve_memory(
    config: TraceViewerConfig,
) -> Result<(TraceHandle, impl Future<Output = Result<()>>)>
Expand description

Start the trace viewer server with a memory-backed event source.

Returns a handle to push events and a future that runs the server. The server will poll for new events automatically.

ยงExample

let (handle, server) = agent_client_protocol_trace_viewer::serve_memory(Default::default())?;

// Push events from your application
handle.push(serde_json::json!({"type": "request", "method": "test"}));

// Run the server (or spawn it)
server.await?;