Function canrun::collections::lmap::get

source ·
pub fn get<K, KV, V, VV, B>(key: KV, value: VV, b: B) -> impl Goalwhere
    K: Unify + Eq + Hash + Debug,
    KV: Into<Value<K>>,
    V: Unify + Debug,
    VV: Into<Value<V>>,
    B: Into<Value<LMap<K, V>>>,
Expand description

Assert that the a given key and value combination can be found in an LMap

This is essentially a single key case of subset.

Example:

use canrun::{LVar, Query};
use canrun::lmap::{lmap, get};

let x = LVar::new();
let goal = get(1, x, lmap! {1 => 2});
let results: Vec<_> = goal.query(x).collect();