pub struct Rules { /* private fields */ }
Expand description
A set of validation rules.
If any rule fail, the current contract execution stops, and reverts if the error raised by the first falling rule.
Rules related to voting must be given voting state.
Implementations§
source§impl Rules
impl Rules
sourcepub fn validate_generic_validations(&self)
pub fn validate_generic_validations(&self)
Validates only the rules that don’t need voting state.
sourcepub fn validate_voting_validations(
&self,
voting_state_machine: &VotingStateMachine,
configuration: &Configuration
)
pub fn validate_voting_validations( &self, voting_state_machine: &VotingStateMachine, configuration: &Configuration )
Validates only the rules that require voting state.
sourcepub fn validate(
&self,
voting_state_machine: &VotingStateMachine,
configuration: &Configuration
)
pub fn validate( &self, voting_state_machine: &VotingStateMachine, configuration: &Configuration )
Validates all the rules.
Auto Trait Implementations§
impl !RefUnwindSafe for Rules
impl !Send for Rules
impl !Sync for Rules
impl Unpin for Rules
impl !UnwindSafe for Rules
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more