9 unstable releases (3 breaking)

0.4.0 Feb 26, 2025
0.3.0 Nov 23, 2024
0.2.0 May 28, 2024
0.1.5 Sep 22, 2023
0.1.0 Apr 29, 2021

#564 in Internationalization (i18n)

Download history 7217/week @ 2024-12-14 4517/week @ 2024-12-21 4706/week @ 2024-12-28 6867/week @ 2025-01-04 6956/week @ 2025-01-11 7898/week @ 2025-01-18 6956/week @ 2025-01-25 8762/week @ 2025-02-01 8664/week @ 2025-02-08 8765/week @ 2025-02-15 11105/week @ 2025-02-22 11149/week @ 2025-03-01 10243/week @ 2025-03-08 9772/week @ 2025-03-15 12107/week @ 2025-03-22 8904/week @ 2025-03-29

43,066 downloads per month
Used in 40 crates (4 directly)

Unicode-3.0

385KB
6.5K SLoC

icu_pattern crates.io

icu_pattern is a utility crate of the ICU4X project.

It includes a Pattern type which supports patterns with various storage backends.

The types are tightly coupled with the writeable crate.

Examples

Parsing and interpolating with a single-placeholder pattern:

use icu_pattern::SinglePlaceholderPattern;
use writeable::assert_writeable_eq;

// Parse a pattern string:
let pattern = SinglePlaceholderPattern::try_from_str(
    "Hello, {0}!",
    Default::default(),
)
.unwrap();

// Interpolate into the pattern string:
assert_writeable_eq!(pattern.interpolate(["World"]), "Hello, World!");

More Information

For more information on development, authorship, contributing etc. please visit ICU4X home page.

Dependencies

~245–770KB
~18K SLoC