rust-typed-builder
rust-typed-builder copied to clipboard
Allow invariant checks in `.build()`
I want something like this:
pub struct S {
x: i32,
y: i32,
}
impl S {
fn check_rep(&self) {
assert!(self.x < self.y);
}
}
When .build()
is called, I also want check_rep
to be called.