kroki_rs/browser/
backend.rs

1use crate::diagrams::DiagramResult;
2use async_trait::async_trait;
3
4/// Abstract interface for browser-based diagram rendering.
5/// Managed via a persistent pool of browser contexts.
6#[async_trait]
7pub trait BrowserBackend: Send + Sync {
8    /// Renders a diagram using the browser.
9    async fn render(
10        &self,
11        diagram_type: &str,
12        source: &str,
13        format: &str,
14    ) -> DiagramResult<Vec<u8>>;
15
16    /// Returns health information about the browser instance/pool.
17    async fn health(&self) -> serde_json::Value;
18}