Skip to main content

textfx_serialize_batch

Function textfx_serialize_batch 

Source
pub fn textfx_serialize_batch<'a>(
    configs: impl IntoIterator<Item = &'a TextFxConfig>,
    policy: TextFxRoutePolicy,
    options: TextFxBatchOptions,
) -> Result<TextFxBatchSerializationReport>
Expand description

Serialize TextFX configs for deterministic route manifests and caches.

use dioxus_textfx_core::prelude::*;

let headline = textfx("headline", "Launch ready").scramble();
let policy = textfx_route_policy().route("/launch");
let batch = textfx_serialize_batch([&headline], policy, TextFxBatchOptions::default())?;

assert_eq!(batch.payloads.len(), 1);
assert!(batch.total_bytes > 0);