Expand description
Shared preview request resolution for water preview and the MCP
preview tool.
Both entry points accept the same arguments — a #[preview] function path
or expression target, a frame size, and optional platform/backend/theme
overrides — and resolve them through the functions here, so the two can
never drift apart.
Structs§
- Preview
Request - A fully resolved preview render, ready to hand to the Hydrolysis or support-app execution path.
Enums§
- CliHydrolysis
Preview Theme - Theme package for Hydrolysis preview.
- CliPreview
Backend - Rendering backend for preview.
- CliPreview
Platform - Target platform for preview.
- Preview
Target - What a preview render draws: a
#[preview]function exported from the project crate, or an inlineWaterUIexpression.
Constants§
- DEFAULT_
FRAME - Default frame size shared by
water preview --frameand the MCPpreviewtool’sframeargument.
Functions§
- check_
toolchain_ for_ backend - Check the host toolchain required by the resolved backend.
- ensure_
hydrolysis_ preview_ platform water preview testsupports Hydrolysis on macOS only.- parse_
frame - Parse frame size from a
WIDTHxHEIGHTstring. - render_
with_ symbol - Render
symbolthrough the support-app session, translating a missing export into an actionable#[preview]hint. - resolve_
hydrolysis_ preview_ theme - Resolve the Hydrolysis theme: required for the Hydrolysis backend, rejected for the others.
- resolve_
preview_ backend - Resolve the rendering backend for a platform, applying the override when given.
- resolve_
preview_ platform - Resolve the preview platform, defaulting to this host’s native preview platform.
- resolve_
preview_ target - Resolve the preview target:
exprforces expression mode, and a target that is not a Rust path is treated as an expression either way.