Skip to main content

Module smart_draft

Module smart_draft 

Source
Expand description

The smart folder dialog’s editable form of conditions, kept free of any UI so it can be tested on its own.

drafts turns stored conditions into ConditionDrafts and conditions turns them back. Whatever the user didn’t change comes back byte for byte: an untouched condition or rule is the stored JSON itself, and an edited one is the stored object with only the changed keys replaced, so key order and keys falcon doesn’t know survive. A rule the dialog can’t show (an unknown property, or a method its property doesn’t have) is kept verbatim as RuleDraft::Unsupported.

Structs§

ConditionDraft
One condition in the dialog: its rules combined by any (Eagle’s match: "OR", else "AND"), the result inverted by negate (Eagle’s boolean: "FALSE").
Property
A property the dialog offers.
RuleFields
A rule’s editable fields, all as text.

Enums§

Kind
How a property’s value is entered and stored.
RuleDraft
One rule row in the dialog.

Constants§

PROPERTIES
Every property the evaluator knows, in the dialog’s order.
RATINGS
Rating values for equal and unequal.
SHAPES
Shape values, with falcon’s labels.

Functions§

conditions
conditions back from the dialog, or the first value that can’t be stored (as a message for the user).
drafts
The dialog’s form of a smart folder’s conditions.
method_label
Falcon’s wording for a method of a property kind.
no_value
Whether a method takes no value.
property
units
Units of a property with one, the first being the default when a rule has none (what Eagle’s evaluator assumes).