macro_rules! impl_style_methods {
($ty:ty, $push:expr) => { ... };
}Expand description
Macro to implement styling methods on a type.
This macro generates all the styling methods (color, bold, italic, etc.) for a given type.
The type must have a way to accumulate StyleActions.
§Parameters
$ty: The type to implement styling methods for.$push: A closure that takes the type and aStyleAction, and returns the modified type.
§Example
ⓘ
impl_style_methods!(Cell, |mut cell: Cell, action| {
cell.styles.push(action);
cell
});