Skip to main content

Modifier

Trait Modifier 

Source
pub trait Modifier {
    // Required method
    fn apply(self, content: AnyPiece) -> AnyPiece;
}
Expand description

A one-shot, by-value view transform (the SwiftUI ViewModifier analog): wrap a piece into a new one. Pure composition — no per-backend work. A plain FnOnce(AnyPiece) -> AnyPiece closure is a Modifier too (the blanket impl below), so the common case needs no new type. Apply one with Decorate::modifier.

Required Methods§

Source

fn apply(self, content: AnyPiece) -> AnyPiece

Implementors§

Source§

impl<F> Modifier for F
where F: FnOnce(AnyPiece) -> AnyPiece,

Day API ↩ Guides· daybrite.dev