SinglePlaceholderPattern

Type Alias SinglePlaceholderPattern 

Source
pub type SinglePlaceholderPattern = Pattern<SinglePlaceholder>;
Expand description

§Examples

use core::str::FromStr;
use icu_pattern::SinglePlaceholderPattern;
use writeable::assert_writeable_eq;

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

// Interpolate some values into the pattern:
assert_writeable_eq!(pattern.interpolate(["Alice"]), "Hello, Alice!");

Aliased Type§

#[repr(transparent)]
pub struct SinglePlaceholderPattern { pub store: str, /* private fields */ }

Fields§

§store: str

The encoded storage