Function icu::markers_for_bin

source ·
pub fn markers_for_bin(
    path: &Path,
) -> Result<HashSet<DataMarkerInfo>, DataError>
Expand description

Parses a compiled binary and returns a list of DataMarkerInfos that it uses at runtime.

This function is intended to be used for binaries that use AnyProvider or BufferProvider, for which the compiler cannot remove unused data. Using this function on a binary that only uses compiled data (through the compiled_data feature or manual baked data) will not return any markers, as the markers only exist in the type system.

§Example

assert_eq!(
    icu::markers_for_bin(Path::new("target/release/my-app"))?,
    std::collections::HashSet::from_iter([
        icu::list::provider::AndListV2Marker::INFO,
        icu::list::provider::OrListV2Marker::INFO,
    ]),
);