Skip to main content

render_partial

Function render_partial 

Source
pub fn render_partial(
    protocol: &WebUIProtocol,
    entry_id: &str,
    request_path: &str,
    inventory_hex: &str,
    index: &mut ProtocolIndex,
) -> Result<Value, HandlerError>
Expand description

Produce a JSON partial response for client-side navigation.

Returns the matched route chain, templates, inventory, and cache tags. State is not included — the caller is responsible for adding application state to the response (e.g. as a top-level "state" field for non-streaming, or as NDJSON Chunk 2 for streaming).

Returns a serde_json::Value object with fields:

  • templateStyles: module CSS definition tags for inventory-new components (empty for Link/Style)
  • templates: client template metadata keyed by component tag (inventory-filtered)
  • templateFunctions: component-local condition closure arrays keyed by component tag
  • inventory: updated hex bitmask
  • path: the request path
  • chain: matched route chain array
  • cacheTags: resolved cache tags from the full route chain (union of all levels)