Crate predicate

Source
Expand description

§Predicate

Use enum to predicate something.

Just need to implement Predicate Trait with predicate-macros crate, support | and & operator.

Don’t implement traits by self.

How to work: https://github.com/Spxg/predicate/blob/master/how_to_work.png.

§Feature

  • rc (default)
  • arc

Enable Arc Feature:

[dependencies.predicate]
version = "0.1"
default-features = false
features = ["arc"]

Structs§

OpUnit
OpUnit<T> is a tree structure.
PredicateRet
Wrap OpUnitRcType<T>.

Enums§

Operation
Operation Type.

Traits§

OpUnitTrait
OpUnitTrait is used to get op unit.
Predicate
Only need to impl Predicate with rules method for T if T has impl OpUnitTrait.

Type Aliases§

OpUnitRcType
A single-threaded reference-counting pointer. ‘Rc’ stands for ‘Reference Counted’. Enable by deafult or feature ‘rc’.