[][src]Function base_emoji::to_custom

pub fn to_custom<T: AsRef<[u8]>, F: Fn(&str, &str) -> String>(
    buf: T,
    f: F
) -> String

Encode buffer as custom-mapped string

let input = [0xde];
let output = "<img src='/img/snowflake.png' alt='❄️' title='snowflake'>";
assert_eq!(
    base_emoji::to_custom(&input, |ch, name| {
        format!("<img src='/img/{}.png' alt='{}' title='{}'>",
                name, ch, name)
    }),
    output);