Skip to main content

Module request

Module request 

Source
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§

PreviewRequest
A fully resolved preview render, ready to hand to the Hydrolysis or support-app execution path.

Enums§

CliHydrolysisPreviewTheme
Theme package for Hydrolysis preview.
CliPreviewBackend
Rendering backend for preview.
CliPreviewPlatform
Target platform for preview.
PreviewTarget
What a preview render draws: a #[preview] function exported from the project crate, or an inline WaterUI expression.

Constants§

DEFAULT_FRAME
Default frame size shared by water preview --frame and the MCP preview tool’s frame argument.

Functions§

check_toolchain_for_backend
Check the host toolchain required by the resolved backend.
ensure_hydrolysis_preview_platform
water preview test supports Hydrolysis on macOS only.
parse_frame
Parse frame size from a WIDTHxHEIGHT string.
render_with_symbol
Render symbol through 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: expr forces expression mode, and a target that is not a Rust path is treated as an expression either way.