use std::fmt::Debug;
use hamon::{builder::OrderedBuild, prelude::*, AllowStep};
struct Encyption;
#[derive(AllowStep)]
#[from(Encyption)]
struct Compression;
impl<T: Debug> Decorator<T, T> for Encyption {
fn produce(&mut self, input: T) -> T {
println!("{:<15}===> Data is {input:?}", "Encryption");
input
}
}
impl<T: Debug> Decorator<T, T> for Compression {
fn produce(&mut self, input: T) -> T {
println!("{:<15}===> Data is {input:?}", "Compression");
input
}
}
fn main() {
let result = OrderedBuild::new(10)
.step(Encyption)
.step(Compression)
.build();
}