dioxus-hoverfx-core
Serializable configuration for worker-first cursor proximity hover effects.
use ;
let config = new
.with_default_effect
.with_radius_px
.with_shape
.with_falloff
.with_strength
.with_effect;
assert!;
let json = to_string?;
# Ok::
Built-in presets are spotlight, soft-glow, border-trace, sheen, and
color-wash. Defaults are tuned for worker-first rendering: 180px radius,
smooth falloff, 1.0 strength, 0.18 pointer smoothing, and up to 8 active
elements per frame.
Install
[]
= "0.1.0-alpha.3"
Release Status
- Current crate version:
0.1.0-alpha.3. - Release wave: June 8, 2026 workspace integration update.
- Publish status: Prepared as a crates.io update for this package.
- Scope: Serializable worker-first cursor hover effect configuration for Dioxus.
- The README install examples and local workspace dependency requirements are aligned with this publish wave.
API Syntax Gallery
Generated from the crate's rustdoc JSON so the visible syntax tracks the public API surface used for DX review.
Checked Import Smoke Test
extern crate dioxus_hoverfx_core as api;
crate root
Modules
pub mod prelude;
Re-exports
pub use integration::*;
Constants
pub const DEFAULT_HOVERFX_RUNTIME_BASE_PATH: &str;
pub const DEFAULT_HOVERFX_WORKER_BASE_PATH: &str;
pub const DEFAULT_HOVERFX_RUNTIME_VERSION: &str;
pub const DEFAULT_HOVERFX_WORKER_VERSION: &str;
pub const DEFAULT_HOVERFX_RUNTIME_PATH: &str;
pub const DEFAULT_HOVERFX_WORKER_PATH: &str;
pub const HOVERFX_PACKAGE_NAME: &str;
pub const HOVERFX_PACKAGE_VERSION: &str;
pub const DEFAULT_HOVERFX_RADIUS_PX: u16;
pub const DEFAULT_HOVERFX_RANGE_PX: u16;
pub const DEFAULT_HOVERFX_STRENGTH: f32;
pub const DEFAULT_HOVERFX_SMOOTHING: f32;
pub const DEFAULT_HOVERFX_MAX_ACTIVE_ELEMENTS: u16;
pub const DEFAULT_HOVERFX_PERF_LAZY_LOCAL_LAYERS: bool;
pub const DEFAULT_HOVERFX_PERF_WORKER_LOCAL_LAYERS: bool;
pub const DEFAULT_HOVERFX_PERF_DIRTY_RECT_RENDERING: bool;
pub const DEFAULT_HOVERFX_PERF_SHADER_TEXTURE_CACHE: bool;
pub const DEFAULT_HOVERFX_PERF_DPR_CAP: f32;
pub const DEFAULT_HOVERFX_PERF_IDLE_RELEASE_TIMEOUT_MS: u16;
pub const MIN_HOVERFX_RADIUS_PX: u16;
pub const MAX_HOVERFX_RADIUS_PX: u16;
pub const MIN_HOVERFX_RANGE_PX: u16;
pub const MAX_HOVERFX_RANGE_PX: u16;
pub const MAX_HOVERFX_STRENGTH: f32;
pub const MAX_HOVERFX_MAX_ACTIVE_ELEMENTS: u16;
pub const MIN_HOVERFX_PERF_DPR_CAP: f32;
pub const MAX_HOVERFX_PERF_DPR_CAP: f32;
pub const MAX_HOVERFX_PERF_IDLE_RELEASE_TIMEOUT_MS: u16;
pub const MAX_HOVERFX_PERF_CANDIDATE_OBSERVER_MARGIN_PX: u16;
pub const DEFAULT_HOVERFX_TEXT_REVEAL_CHARSET: &str;
pub const DEFAULT_HOVERFX_TEXT_REVEAL_CYCLE_SPEED_MS: u16;
pub const DEFAULT_HOVERFX_TEXT_REVEAL_DENSITY: f32;
pub const DEFAULT_HOVERFX_TEXT_REVEAL_FONT_SIZE_PX: u16;
pub const DEFAULT_HOVERFX_TEXT_REVEAL_GAP_PX: u16;
pub const DEFAULT_HOVERFX_TEXT_REVEAL_FONT_FAMILY: &str;
pub const DEFAULT_HOVERFX_TEXT_REVEAL_COLOR: &str;
pub const DEFAULT_HOVERFX_TEXT_REVEAL_TEXTFX_EFFECT: &str;
pub const DEFAULT_HOVERFX_TOOLTIP_OFFSET_PX: u16;
pub const DEFAULT_HOVERFX_TOOLTIP_MAX_WIDTH_PX: u16;
pub const DEFAULT_HOVERFX_TOOLTIP_SHOW_DELAY_MS: u16;
pub const DEFAULT_HOVERFX_TOOLTIP_HIDE_DELAY_MS: u16;
pub const DEFAULT_HOVERFX_TOOLTIP_DURATION_MS: u16;
pub const DEFAULT_HOVERFX_TOOLTIP_SPEED_MS: u16;
pub const DEFAULT_HOVERFX_TOOLTIP_STAGGER_MS: u16;
pub const DEFAULT_HOVERFX_TOOLTIP_TEXTFX_EFFECT: &str;
pub const DEFAULT_HOVERFX_TOOLTIP_SPLIT: &str;
pub const DEFAULT_HOVERFX_TOOLTIP_BOX_OPACITY: f32;
pub const MIN_HOVERFX_TOOLTIP_MAX_WIDTH_PX: u16;
pub const MAX_HOVERFX_TOOLTIP_MAX_WIDTH_PX: u16;
pub const MAX_HOVERFX_TOOLTIP_OFFSET_PX: u16;
pub const MAX_HOVERFX_TOOLTIP_DELAY_MS: u16;
pub const MAX_HOVERFX_TOOLTIP_DURATION_MS: u16;
pub const MAX_HOVERFX_TOOLTIP_TEXT_CHARS: usize;
pub const MIN_HOVERFX_TOOLTIP_BOX_OPACITY: f32;
pub const MAX_HOVERFX_TOOLTIP_BOX_OPACITY: f32;
pub const DEFAULT_HOVERFX_SAND_GRAIN_SIZE_PX: f32;
pub const DEFAULT_HOVERFX_SAND_GRAIN_DENSITY: f32;
pub const DEFAULT_HOVERFX_SAND_SHIMMER_DENSITY: f32;
pub const DEFAULT_HOVERFX_SAND_SHIMMER_STRENGTH: f32;
pub const DEFAULT_HOVERFX_SAND_SHIMMER_RADIUS_PX: f32;
pub const DEFAULT_HOVERFX_SAND_SPECULAR_STRENGTH: f32;
pub const DEFAULT_HOVERFX_SAND_ROUGHNESS: f32;
pub const DEFAULT_HOVERFX_SAND_ANIMATION_SPEED_MS: u16;
pub const DEFAULT_HOVERFX_SAND_COLOR: &str;
pub const DEFAULT_HOVERFX_SAND_HIGHLIGHT_COLOR: &str;
pub const MIN_HOVERFX_SAND_ANIMATION_SPEED_MS: u16;
pub const MAX_HOVERFX_SAND_ANIMATION_SPEED_MS: u16;
pub const MIN_HOVERFX_TEXT_REVEAL_CYCLE_SPEED_MS: u16;
pub const MAX_HOVERFX_TEXT_REVEAL_CYCLE_SPEED_MS: u16;
pub const MAX_HOVERFX_TEXT_REVEAL_CHARSET_CHARS: usize;
pub const MAX_HOVERFX_TEXT_REVEAL_FONT_SIZE_PX: u16;
pub const MAX_HOVERFX_TEXT_REVEAL_GAP_PX: u16;
pub const SUPPORTED_HOVERFX_TEXTFX_EFFECTS: [&str; 7];
Type Aliases
pub type HoverCfg = HoverFxConfig;
pub type HoverDef = HoverFxDefinition;
pub type HoverReg = HoverFxRegistry;
pub type HoverPerf = HoverFxPerformanceConfig;
Free Functions
hoverfx() -> HoverFxConfig
hover_fx() -> HoverFxConfig
hover_def(id: impl AsRef<str>, label: impl Into<String>) -> HoverFxDefinition
apply_hoverfx_manifest_hook<H>(config: &HoverFxConfig, policy: &HoverFxRoutePolicy, hook: &H) -> Option<HoverFxManifestFragment>
hoverfx_route_policy() -> HoverFxRoutePolicy
hoverfx_output_budget() -> HoverFxOutputBudget
hoverfx_cache_key(config: &HoverFxConfig, route: Option<&str>, extra: Option<&str>) -> String
hoverfx_manifest_fragment(config: &HoverFxConfig, policy: &HoverFxRoutePolicy) -> HoverFxManifestFragment
hoverfx_output_report(config: &HoverFxConfig, policy: &HoverFxRoutePolicy) -> HoverFxOutputReport
explain_hoverfx(config: &HoverFxConfig, policy: &HoverFxRoutePolicy) -> HoverFxExplainReport
hoverfx_compatibility_matrix() -> HoverFxCompatibilityMatrix
hoverfx_native_port_hints(config: &HoverFxConfig, policy: &HoverFxRoutePolicy) -> std::collections::BTreeMap<String, String>
hoverfx_id(id: impl AsRef<str>) -> String
is_hoverfx_id(id: &str) -> bool
is_custom_property_name(name: &str) -> bool
is_safe_css_custom_value(value: &str) -> bool
is_supported_textfx_effect(effect: &str) -> bool
Types, Variants, Fields, and Methods
pub enum HoverFxPreset { ... }
variants: Spotlight, SoftGlow, BorderTrace, Sheen, ColorWash, BinaryReveal, TextureReveal, Sand, Tooltip
methods:
HoverFxPreset::all() -> &'static [Self; 9]
value.as_attr() -> &'static str
value.label() -> &'static str
pub enum HoverFxTextAnimationSource { ... }
variants: HoverFx, TextFx, Auto
methods:
value.as_attr() -> &'static str
pub enum HoverFxTextContrastMode { ... }
variants: Off, Auto, Darken, Invert
methods:
value.as_attr() -> &'static str
pub enum HoverFxTextRevealRenderer { ... }
variants: GlyphAtlas, CanvasGrid
methods:
value.as_attr() -> &'static str
pub enum HoverFxTextureRevealMode { ... }
variants: Auto, Halftone, StaticGrain
methods:
value.as_attr() -> &'static str
pub struct HoverFxTextureRevealConfig { ... }
fields:
.mode: HoverFxTextureRevealMode
methods:
HoverFxTextureRevealConfig::new() -> Self
value.with_mode(mode: HoverFxTextureRevealMode) -> Self
value.to_json() -> serde_json::Result<String>
pub enum HoverFxSandColorSource { ... }
variants: Custom, Element
pub struct HoverFxSandConfig { ... }
fields:
.grain_size_px: f32
.grain_density: f32
.shimmer_density: f32
.shimmer_strength: f32
.shimmer_radius_px: f32
.specular_strength: f32
.roughness: f32
.animation_speed_ms: u16
.color_source: HoverFxSandColorSource
.color: String
.highlight_color: String
methods:
HoverFxSandConfig::new() -> Self
value.with_grain_size_px(grain_size_px: f32) -> Self
value.with_grain_density(grain_density: f32) -> Self
value.with_shimmer_density(shimmer_density: f32) -> Self
value.with_shimmer_strength(shimmer_strength: f32) -> Self
value.with_shimmer_radius_px(shimmer_radius_px: f32) -> Self
value.with_specular_strength(specular_strength: f32) -> Self
value.with_roughness(roughness: f32) -> Self
value.with_animation_speed_ms(animation_speed_ms: u16) -> Self
value.with_color_source(color_source: HoverFxSandColorSource) -> Self
value.with_color(color: impl Into<String>) -> Self
value.with_highlight_color(highlight_color: impl Into<String>) -> Self
value.to_json() -> serde_json::Result<String>
pub enum HoverFxShape { ... }
variants: Circle, Square, RoundedRect, Polygon
methods:
HoverFxShape::all() -> &'static [Self; 4]
value.as_attr() -> &'static str
value.label() -> &'static str
pub enum HoverFxFalloff { ... }
variants: Hard, Linear, Smooth, Exponential
methods:
HoverFxFalloff::all() -> &'static [Self; 4]
value.as_attr() -> &'static str
value.label() -> &'static str
pub enum HoverFxRenderer { ... }
variants: WorkerFirst, CssOnly, Disabled
methods:
value.as_attr() -> &'static str
value.uses_worker() -> bool
pub struct HoverFxTextRevealConfig { ... }
fields:
.charset: String
.cycle: bool
.cycle_speed_ms: u16
.density: f32
.font_size_px: u16
.gap_px: u16
.font_family: String
.color: String
.animation_source: HoverFxTextAnimationSource
.renderer: HoverFxTextRevealRenderer
.textfx_effect: String
methods:
HoverFxTextRevealConfig::new() -> Self
value.with_charset(charset: impl Into<String>) -> Self
value.with_cycle(cycle: bool) -> Self
value.with_cycle_speed_ms(cycle_speed_ms: u16) -> Self
value.with_density(density: f32) -> Self
value.with_font_size_px(font_size_px: u16) -> Self
value.with_gap_px(gap_px: u16) -> Self
value.with_font_family(font_family: impl Into<String>) -> Self
value.with_color(color: impl Into<String>) -> Self
value.with_animation_source(animation_source: HoverFxTextAnimationSource) -> Self
value.with_renderer(renderer: HoverFxTextRevealRenderer) -> Self
value.with_textfx_effect(textfx_effect: impl AsRef<str>) -> Self
value.to_json() -> serde_json::Result<String>
value.to_textfx_config_json(id: impl AsRef<str>, text: impl AsRef<str>) -> serde_json::Result<String>
pub enum HoverFxTooltipPlacement { ... }
variants: Top, Right, Bottom, Left, Cursor
methods:
value.as_attr() -> &'static str
pub struct HoverFxTooltipConfig { ... }
fields:
.text: String
.i18n_key: Option<String>
.placement: HoverFxTooltipPlacement
.offset_px: u16
.max_width_px: u16
.box_opacity: f32
.show_delay_ms: u16
.hide_delay_ms: u16
.duration_ms: u16
.speed_ms: u16
.stagger_ms: u16
.textfx_effect: String
.split: String
methods:
HoverFxTooltipConfig::new(text: impl Into<String>) -> Self
value.with_text(text: impl Into<String>) -> Self
value.with_i18n_key(key: impl AsRef<str>) -> Self
value.i18n_key(key: impl AsRef<str>) -> Self
value.key(key: impl AsRef<str>) -> Self
value.locale_key(key: impl AsRef<str>) -> Self
value.with_placement(placement: HoverFxTooltipPlacement) -> Self
value.top() -> Self
value.right() -> Self
value.bottom() -> Self
value.left() -> Self
value.cursor() -> Self
value.with_offset_px(offset_px: u16) -> Self
value.offset(offset_px: u16) -> Self
value.with_max_width_px(max_width_px: u16) -> Self
value.max_width(max_width_px: u16) -> Self
value.with_box_opacity(box_opacity: f32) -> Self
value.box_opacity(box_opacity: f32) -> Self
value.opacity(box_opacity: f32) -> Self
value.with_show_delay_ms(show_delay_ms: u16) -> Self
value.show_delay_ms(show_delay_ms: u16) -> Self
value.with_hide_delay_ms(hide_delay_ms: u16) -> Self
value.hide_delay_ms(hide_delay_ms: u16) -> Self
value.with_duration_ms(duration_ms: u16) -> Self
value.dur_ms(duration_ms: u16) -> Self
value.with_speed_ms(speed_ms: u16) -> Self
value.speed_ms(speed_ms: u16) -> Self
value.with_stagger_ms(stagger_ms: u16) -> Self
value.stagger_ms(stagger_ms: u16) -> Self
value.with_textfx_effect(textfx_effect: impl AsRef<str>) -> Self
value.scramble() -> Self
value.typewriter() -> Self
value.wave() -> Self
value.glitch() -> Self
value.with_split(split: impl Into<String>) -> Self
value.split_chars() -> Self
value.split_words() -> Self
value.to_json() -> serde_json::Result<String>
value.to_textfx_config_json(id: impl AsRef<str>, fallback_text: impl AsRef<str>) -> serde_json::Result<String>
pub enum HoverFxValidationSeverity { ... }
variants: Error, Warning
pub enum HoverFxValidationCode { ... }
variants: MissingDefaultEffect, InvalidDefaultEffectId, InvalidEffectId, EmptyRuntimePath, EmptyWorkerPath, InvalidRadius, InvalidRange, InvalidStrength, InvalidSmoothing, InvalidMaxActiveElements, InvalidCssVariableName, UnsafeCssValue, UnsafeCustomShapeValue, InvalidTextRevealCharset, InvalidTextRevealCycleSpeed, InvalidTextRevealMetric, UnsafeTextRevealCssValue, UnsupportedTextFxEffect, InvalidTooltipMetric, InvalidTooltipText, InvalidTooltipI18nKey, InvalidSandMetric, InvalidSandAnimationSpeed, UnsafeSandCssValue, InvalidPerformanceMetric
pub struct HoverFxValidationIssue { ... }
fields:
.severity: HoverFxValidationSeverity
.code: HoverFxValidationCode
.message: String
.field: Option<String>
.effect: Option<String>
methods:
HoverFxValidationIssue::error(code: HoverFxValidationCode, field: impl Into<String>, message: impl Into<String>) -> Self
HoverFxValidationIssue::effect_error(code: HoverFxValidationCode, effect: impl Into<String>, field: impl Into<String>, message: impl Into<String>) -> Self
pub struct HoverFxValidationReport { ... }
fields:
.issues: Vec<HoverFxValidationIssue>
methods:
value.is_valid() -> bool
value.errors() -> impl Iterator<Item = &HoverFxValidationIssue>
value.warnings() -> impl Iterator<Item = &HoverFxValidationIssue>
value.push(issue: HoverFxValidationIssue)
pub struct HoverFxDefinition { ... }
fields:
.id: String
.label: String
.preset: Option<HoverFxPreset>
.radius_px: Option<u16>
.range_px: Option<u16>
.shape: Option<HoverFxShape>
.falloff: Option<HoverFxFalloff>
.strength: Option<f32>
.smoothing: Option<f32>
.custom_shape: Option<String>
.text_reveal: Option<HoverFxTextRevealConfig>
.texture_reveal: Option<HoverFxTextureRevealConfig>
.sand: Option<HoverFxSandConfig>
.tooltip: Option<HoverFxTooltipConfig>
.text_contrast: Option<HoverFxTextContrastMode>
.css_vars: std::collections::BTreeMap<String, String>
methods:
HoverFxDefinition::new(id: impl AsRef<str>, label: impl Into<String>) -> Self
HoverFxDefinition::from_preset(preset: HoverFxPreset) -> Self
value.with_label(label: impl Into<String>) -> Self
value.with_preset(preset: HoverFxPreset) -> Self
value.with_radius_px(radius_px: u16) -> Self
value.radius(radius_px: u16) -> Self
value.radius_px(radius_px: u16) -> Self
value.with_range_px(range_px: u16) -> Self
value.range(range_px: u16) -> Self
value.range_px(range_px: u16) -> Self
value.activation_range(range_px: u16) -> Self
value.with_shape(shape: HoverFxShape) -> Self
value.with_falloff(falloff: HoverFxFalloff) -> Self
value.with_strength(strength: f32) -> Self
value.with_smoothing(smoothing: f32) -> Self
value.with_custom_shape(custom_shape: impl Into<String>) -> Self
value.with_text_reveal(text_reveal: HoverFxTextRevealConfig) -> Self
value.with_texture_reveal(texture_reveal: HoverFxTextureRevealConfig) -> Self
value.with_sand(sand: HoverFxSandConfig) -> Self
value.with_tooltip(tooltip: HoverFxTooltipConfig) -> Self
value.with_text_contrast(text_contrast: HoverFxTextContrastMode) -> Self
value.with_css_var(name: impl Into<String>, value: impl Into<String>) -> Self
value.with_css_vars<I, K, V>(css_vars: I) -> Self
pub struct HoverFxRegistry { ... }
fields:
.effects: Vec<HoverFxDefinition>
methods:
HoverFxRegistry::new() -> Self
HoverFxRegistry::defaults() -> Self
value.with_effect(effect: HoverFxDefinition) -> Self
value.with_effects<I>(effects: I) -> Self
value.insert_effect(effect: HoverFxDefinition) -> Option<HoverFxDefinition>
value.contains_effect(id: impl AsRef<str>) -> bool
value.effect(id: impl AsRef<str>) -> Option<&HoverFxDefinition>
value.effect_ids() -> Vec<&str>
pub struct HoverFxPerformanceConfig { ... }
fields:
.lazy_local_layers: bool
.worker_local_layers: bool
.dirty_rect_rendering: bool
.shader_texture_cache: bool
.dpr_cap: f32
.idle_release_timeout_ms: u16
.candidate_observer_margin_px: Option<u16>
.motion_lane: Option<String>
.motion_scope: Option<String>
.view_transition_name_isolation: Option<String>
methods:
HoverFxPerformanceConfig::new() -> Self
value.with_lazy_local_layers(lazy_local_layers: bool) -> Self
value.with_worker_local_layers(worker_local_layers: bool) -> Self
value.with_dirty_rect_rendering(dirty_rect_rendering: bool) -> Self
value.with_shader_texture_cache(shader_texture_cache: bool) -> Self
value.with_dpr_cap(dpr_cap: f32) -> Self
value.with_idle_release_timeout_ms(idle_release_timeout_ms: u16) -> Self
value.with_candidate_observer_margin_px(candidate_observer_margin_px: u16) -> Self
pub struct HoverFxConfig { ... }
fields:
.registry: HoverFxRegistry
.default_effect: String
.radius_px: u16
.range_px: u16
.shape: HoverFxShape
.falloff: HoverFxFalloff
.strength: f32
.smoothing: f32
.max_active_elements: u16
.renderer: HoverFxRenderer
.runtime_path: String
.worker_path: String
.performance: HoverFxPerformanceConfig
methods:
HoverFxConfig::new() -> Self
value.with_registry(registry: HoverFxRegistry) -> Self
value.registry(registry: HoverFxRegistry) -> Self
value.with_effect(effect: HoverFxDefinition) -> Self
value.effect(effect: HoverFxDefinition) -> Self
value.with_effects<I>(effects: I) -> Self
value.effects<I>(effects: I) -> Self
value.with_default_effect(default_effect: impl AsRef<str>) -> Self
value.default_effect(default_effect: impl AsRef<str>) -> Self
value.with_radius_px(radius_px: u16) -> Self
value.radius(radius_px: u16) -> Self
value.radius_px(radius_px: u16) -> Self
value.with_range_px(range_px: u16) -> Self
value.range(range_px: u16) -> Self
value.range_px(range_px: u16) -> Self
value.activation_range(range_px: u16) -> Self
value.with_shape(shape: HoverFxShape) -> Self
value.shape(shape: HoverFxShape) -> Self
value.with_falloff(falloff: HoverFxFalloff) -> Self
value.falloff(falloff: HoverFxFalloff) -> Self
value.with_strength(strength: f32) -> Self
value.strength(strength: f32) -> Self
value.with_smoothing(smoothing: f32) -> Self
value.smooth(smoothing: f32) -> Self
value.with_max_active_elements(max_active_elements: u16) -> Self
value.max_active(max_active_elements: u16) -> Self
value.with_renderer(renderer: HoverFxRenderer) -> Self
value.renderer(renderer: HoverFxRenderer) -> Self
value.with_runtime_path(runtime_path: impl Into<String>) -> Self
value.runtime(runtime_path: impl Into<String>) -> Self
value.with_worker_path(worker_path: impl Into<String>) -> Self
value.worker_path(worker_path: impl Into<String>) -> Self
value.worker() -> Self
value.no_worker() -> Self
value.with_performance(performance: HoverFxPerformanceConfig) -> Self
value.perf(performance: HoverFxPerformanceConfig) -> Self
value.with_lazy_local_layers(lazy_local_layers: bool) -> Self
value.lazy_layers_enabled(lazy_local_layers: bool) -> Self
value.lazy_layers() -> Self
value.no_lazy_layers() -> Self
value.with_worker_local_layers(worker_local_layers: bool) -> Self
value.worker_layers(worker_local_layers: bool) -> Self
value.with_dirty_rect_rendering(dirty_rect_rendering: bool) -> Self
value.dirty_rects(dirty_rect_rendering: bool) -> Self
value.with_shader_texture_cache(shader_texture_cache: bool) -> Self
value.texture_cache(shader_texture_cache: bool) -> Self
value.with_dpr_cap(dpr_cap: f32) -> Self
value.dpr(dpr_cap: f32) -> Self
value.with_idle_release_timeout_ms(idle_release_timeout_ms: u16) -> Self
value.idle_release_ms(idle_release_timeout_ms: u16) -> Self
value.with_candidate_observer_margin_px(candidate_observer_margin_px: u16) -> Self
value.observer_margin(candidate_observer_margin_px: u16) -> Self
value.validate() -> HoverFxValidationReport
value.to_json() -> serde_json::Result<String>
value.to_stable_json() -> serde_json::Result<String>
value.to_preferred_json(format: HoverFxSerializationFormat) -> serde_json::Result<String>
value.to_compact_json() -> serde_json::Result<String>
value.with_profile(profile: HoverFxPresetProfile) -> Self
value.cache_key(route: Option<&str>) -> String
value.manifest_fragment(policy: &HoverFxRoutePolicy) -> HoverFxManifestFragment
value.output_report(policy: &HoverFxRoutePolicy) -> HoverFxOutputReport
value.explain(policy: &HoverFxRoutePolicy) -> HoverFxExplainReport
value.try_validated() -> Result<Self, HoverFxConfigError>
value.is_noop_for_route(policy: &HoverFxRoutePolicy) -> bool
pub struct HoverFxConfigError { ... }
fields:
.report: HoverFxValidationReport
pub enum HoverFxRuntimeEmission { ... }
variants: Always, WhenUsed, CssOnly, Disabled
methods:
value.as_attr() -> &'static str
pub enum HoverFxSerializationFormat { ... }
variants: StableJson, ReadableJson, CompactJson
methods:
value.as_attr() -> &'static str
pub enum HoverFxDiagnosticVerbosity { ... }
variants: Off, Summary, Detailed
pub enum HoverFxFallbackStrategy { ... }
variants: StaticCss, NativePort, MainThread, DisableEffect
pub enum HoverFxPresetProfile { ... }
variants: Conservative, Balanced, Aggressive
methods:
value.as_attr() -> &'static str
value.apply_to_config(config: &mut HoverFxConfig)
pub struct HoverFxInteropPolicy { ... }
fields:
.strata: bool
.resume: bool
.native_port: bool
.workertown: bool
.textfx: bool
.theme: bool
.viewtx: bool
pub struct HoverFxOutputBudget { ... }
fields:
.max_config_bytes: Option<usize>
.max_runtime_bytes: Option<usize>
.max_style_bytes: Option<usize>
.max_effect_count: Option<usize>
methods:
HoverFxOutputBudget::new() -> Self
value.config_bytes(max: usize) -> Self
value.runtime_bytes(max: usize) -> Self
value.style_bytes(max: usize) -> Self
value.effect_count(max: usize) -> Self
pub struct HoverFxRoutePolicy { ... }
fields:
.route: Option<String>
.enabled: bool
.profile: HoverFxPresetProfile
.emission: HoverFxRuntimeEmission
.serialization: HoverFxSerializationFormat
.diagnostics: HoverFxDiagnosticVerbosity
.fallback: HoverFxFallbackStrategy
.interop: HoverFxInteropPolicy
.budget: HoverFxOutputBudget
.labels: std::collections::BTreeMap<String, String>
.tags: Vec<String>
methods:
HoverFxRoutePolicy::new() -> Self
value.route(route: impl Into<String>) -> Self
value.enabled(enabled: bool) -> Self
value.profile(profile: HoverFxPresetProfile) -> Self
value.emission(emission: HoverFxRuntimeEmission) -> Self
value.serialization(serialization: HoverFxSerializationFormat) -> Self
value.diagnostics(diagnostics: HoverFxDiagnosticVerbosity) -> Self
value.fallback(fallback: HoverFxFallbackStrategy) -> Self
value.budget(budget: HoverFxOutputBudget) -> Self
value.label(key: impl Into<String>, value: impl Into<String>) -> Self
value.tag(tag: impl Into<String>) -> Self
pub struct HoverFxManifestFragment { ... }
fields:
.package: String
.version: String
.route: Option<String>
.enabled: bool
.cache_key: String
.default_effect: String
.runtime_path: String
.worker_path: String
.profile: HoverFxPresetProfile
.emission: HoverFxRuntimeEmission
.fallback: HoverFxFallbackStrategy
.labels: std::collections::BTreeMap<String, String>
.tags: Vec<String>
.metrics: std::collections::BTreeMap<String, u64>
.policies: std::collections::BTreeMap<String, serde_json::Value>
pub struct HoverFxOutputViolation { ... }
fields:
.field: String
.actual: usize
.budget: usize
pub struct HoverFxOutputReport { ... }
fields:
.package: String
.route: Option<String>
.cache_key: String
.config_bytes: usize
.runtime_bytes: usize
.style_bytes: usize
.effect_count: usize
.violations: Vec<HoverFxOutputViolation>
methods:
value.is_within_budget() -> bool
pub struct HoverFxExplainReport { ... }
fields:
.package: String
.route: Option<String>
.cache_key: String
.runtime_decision: String
.style_decision: String
.fallback_decision: String
.validation: HoverFxValidationReport
.manifest: HoverFxManifestFragment
.output: HoverFxOutputReport
.notes: Vec<String>
pub struct HoverFxCompatibilityRow { ... }
fields:
.target: String
.support: String
.runtime: String
.fallback: String
.notes: String
pub struct HoverFxCompatibilityMatrix { ... }
fields:
.package: String
.rows: Vec<HoverFxCompatibilityRow>
pub trait HoverFxManifestPolicyHook { ... }
fn apply(self: &Self, fragment: HoverFxManifestFragment) -> Option<HoverFxManifestFragment>;
prelude
Re-exports
pub use crate::HoverCfg as HoverCfg;
pub use crate::HoverDef as HoverDef;
pub use crate::HoverFxCompatibilityMatrix as HoverFxCompatibilityMatrix;
pub use crate::HoverFxCompatibilityRow as HoverFxCompatibilityRow;
pub use crate::HoverFxConfig as HoverFxConfig;
pub use crate::HoverFxDefinition as HoverFxDefinition;
pub use crate::HoverFxDiagnosticVerbosity as HoverFxDiagnosticVerbosity;
pub use crate::HoverFxExplainReport as HoverFxExplainReport;
pub use crate::HoverFxFallbackStrategy as HoverFxFallbackStrategy;
pub use crate::HoverFxFalloff as HoverFxFalloff;
pub use crate::HoverFxInteropPolicy as HoverFxInteropPolicy;
pub use crate::HoverFxManifestFragment as HoverFxManifestFragment;
pub use crate::HoverFxManifestPolicyHook as HoverFxManifestPolicyHook;
pub use crate::HoverFxOutputBudget as HoverFxOutputBudget;
pub use crate::HoverFxOutputReport as HoverFxOutputReport;
pub use crate::HoverFxOutputViolation as HoverFxOutputViolation;
pub use crate::HoverFxPerformanceConfig as HoverFxPerformanceConfig;
pub use crate::HoverFxPreset as HoverFxPreset;
pub use crate::HoverFxPresetProfile as HoverFxPresetProfile;
pub use crate::HoverFxRegistry as HoverFxRegistry;
pub use crate::HoverFxRenderer as HoverFxRenderer;
pub use crate::HoverFxRoutePolicy as HoverFxRoutePolicy;
pub use crate::HoverFxRuntimeEmission as HoverFxRuntimeEmission;
pub use crate::HoverFxSerializationFormat as HoverFxSerializationFormat;
pub use crate::HoverFxShape as HoverFxShape;
pub use crate::HoverFxTooltipConfig as HoverFxTooltipConfig;
pub use crate::HoverFxTooltipPlacement as HoverFxTooltipPlacement;
pub use crate::HoverPerf as HoverPerf;
pub use crate::HoverReg as HoverReg;
pub use crate::explain_hoverfx as explain_hoverfx;
pub use crate::hover_def as hover_def;
pub use crate::hover_fx as hover_fx;
pub use crate::hoverfx as hoverfx;
pub use crate::hoverfx_cache_key as hoverfx_cache_key;
pub use crate::hoverfx_compatibility_matrix as hoverfx_compatibility_matrix;
pub use crate::hoverfx_manifest_fragment as hoverfx_manifest_fragment;
pub use crate::hoverfx_native_port_hints as hoverfx_native_port_hints;
pub use crate::hoverfx_output_budget as hoverfx_output_budget;
pub use crate::hoverfx_output_report as hoverfx_output_report;
pub use crate::hoverfx_route_policy as hoverfx_route_policy;
pub use crate::integration::*;
Integration Recipes
Route-level integrations can build one manifest and reuse it across SSR, Strata-style route metadata, asset-budget reports, and optimizer caches:
use *;
let config = hoverfx.with_default_effect;
let policy = hoverfx_route_policy
.route
.diagnostics
.fallback;
let manifest = hoverfx_manifest_fragment;
let batch = hoverfx_serialize_batch?;
let budget = hoverfx_asset_budget_bridge;
let migration = hoverfx_strata_migration_plan;
assert_eq!;
assert!;
assert!;
assert!;
# Ok::
For deterministic build output, use HoverFxBatchOptions { deterministic_parallel: true, ..Default::default() }. HoverFxRuntimeIds::duplicate_ids and
deduped guard generated script/style ids, hoverfx_optimizer_artifacts
returns minifier/cache-friendly hashes, and hoverfx_workertown_offload_plan
describes serializable off-main-thread tasks.