Macro horrorshow::labels [] [src]

macro_rules! labels {
    ($($tail:tt)+) => { ... };
}

Utility macro for generating a space-delimited string from a set of labels; some of which may be conditionally included into the final string. Labels are anything that implements the RenderOnce trait (e.g. String or &str).

This macro is an alias of: labels_sep_by!(" "; maybe_label,...)

Usage: labels!(maybe_label,...)

This useful in generating class attribute as follows:

html! {
    div(class = labels!("active" => true, "button-style")) {
        : "This is a button"
    }
}