pub struct DutyDefinitionCommon {
pub violated_when: Vec<Expression>,
pub enforced_by: Vec<String>,
}
Expand description
Represents common fields for all duty-like definition phrases.
Fields§
§violated_when: Vec<Expression>
A list of boolean expressions that will trigger the Duty violated if any of them holds true while the Duty itself holds true.
enforced_by: Vec<String>
A list of type identifiers that define a set of types that, when any of them becomes true, violates this Duty.
Note that this list is quite restrictive. Only types with the same fields (names, types and order!) are allowed.
To illustrate, enforced-by
is syntax sugar for a particular violated-when
:
Duty must-vote
Holder citizen
Claimant administrator
Enforced by not-voted.
is the same as
Duty must-vote
Holder citizen
Claimant administrator
Violated when Enabled(not-voted(citizen, administrator)).
Trait Implementations§
Source§impl Clone for DutyDefinitionCommon
impl Clone for DutyDefinitionCommon
Source§fn clone(&self) -> DutyDefinitionCommon
fn clone(&self) -> DutyDefinitionCommon
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DutyDefinitionCommon
impl Debug for DutyDefinitionCommon
Source§impl<'de> Deserialize<'de> for DutyDefinitionCommon
impl<'de> Deserialize<'de> for DutyDefinitionCommon
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DutyDefinitionCommon
impl RefUnwindSafe for DutyDefinitionCommon
impl Send for DutyDefinitionCommon
impl Sync for DutyDefinitionCommon
impl Unpin for DutyDefinitionCommon
impl UnwindSafe for DutyDefinitionCommon
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