Crate logru_arithmetic

Source
Expand description

This crate provides arithmetic predicates to use with logru.

  • The predicates are a poor replacement of CLP/FD, sufficient to use with libobscura.
  • Libobscura uses one kind of predicate the most: the range. Itโ€™s used to describe resolutions coming from V4L format enumeration:
  • range(Width, 8, 640, 4). % Width can take values starting from 8, stepping every 4, and the highest possible value is 640,
  • This predicate resolves the variable Width and iterates all its possible values (we donโ€™t expect the values from the driver to come close to i64::max, although that would be bad). This is hopefully enough to propagate all possible values through the V4L subdevice pipeline in a reasonable amount of time.
  • Basic usage of the resolver from Rust:
use logru_arithmetic::{logru, ArithmeticResolver};
use logru::resolve::ResolverExt;
use logru::search::query_dfs;
use logru::textual::TextualUniverse;

let mut tu = TextualUniverse::new();
let mut arith = ArithmeticResolver::new(&mut tu.symbols);
let resolver = arith.by_ref().or_else(tu.resolver());
let query = tu.prepare_query("eq(1, 1).").unwrap();
let mut results = query_dfs(resolver, query.query());

Re-exportsยง

  • pub use logru;

Structsยง

  • A special resolver for integer arithmetic. It provides special predicates which evaluate integer expressions:
  • Range ๐Ÿ”’
    Range inclusive ends.

Enumsยง