seam-server 0.3.7

Framework-agnostic Rust server core for the SeamJS compile-time rendering framework
Documentation

seam-server

Framework-agnostic Rust server core for SeamJS, defining procedures, subscriptions, pages, and an HTML template injector. Use with an adapter crate (e.g. seam-server-axum) for HTTP routing.

Structure

  • src/lib.rsSeamType trait and primitive JTD schema implementations
  • src/server.rsSeamServer builder and SeamParts extraction
  • src/procedure.rsProcedureDef / SubscriptionDef type aliases
  • src/page.rsPageDef / LoaderDef types
  • src/manifest.rs — Build JSON manifest from procedure and subscription definitions
  • src/errors.rsSeamError struct (open code + status)
  • src/injector/ — HTML template engine (tokenize, parse, render)

Template Directives

Directive Purpose
<!--seam:path--> Text slot (HTML-escaped)
<!--seam:path:html--> Raw HTML slot
<!--seam:path:attr:name--> Inject attribute value
<!--seam:if:path-->...<!--seam:endif:path--> Conditional block
<!--seam:each:path-->...<!--seam:endeach--> Iteration block
<!--seam:match:path-->...<!--seam:endmatch--> Pattern matching block

Development

  • Build: cargo build -p seam-server
  • Test: cargo test -p seam-server

Notes

  • The SeamType trait maps Rust types to JTD schemas; derive it with #[derive(SeamType)] from seam-macros
  • The injector pipeline mirrors the TypeScript @canmi/seam-injector but is compiled into this crate
  • SSE subscriptions use BoxStream for async iteration