Skip to content

Allow invariant checks in .build()Β #67

@Banyc

Description

@Banyc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions