1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
//! Rep is a small tool for checking representation/class invariants

pub use rep_derive::*;
pub use rep_derive::check_rep;

/// A trait for representation checking
pub trait CheckRep {
	/// Returns true if representation is correct, false otherwise
    fn is_correct(&self) -> bool;

    /// Asserts that self is correct
	fn check_rep(&self) {
		assert!(self.is_correct());
	}    
}