MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / contains_value

Method contains_value

graphlite/src/cache/subquery_cache.rs:30–43  ·  view source on GitHub ↗

Check if this result matches a value (for IN/NOT IN operations)

(&self, value: &Value)

Source from the content-addressed store, hash-verified

28impl SubqueryResult {
29 /// Check if this result matches a value (for IN/NOT IN operations)
30 pub fn contains_value(&self, value: &Value) -> Option<bool> {
31 match self {
32 SubqueryResult::Set(values) => Some(values.contains(value)),
33 SubqueryResult::Boolean(exists) => Some(*exists),
34 SubqueryResult::Scalar(Some(scalar_value)) => Some(scalar_value == value),
35 SubqueryResult::Scalar(None) => Some(false),
36 SubqueryResult::FullResult(result) => {
37 // Check if value exists in any row/column of the result
38 Some(result.rows.iter().any(|row| {
39 row.positional_values.contains(value) || row.values.values().any(|v| v == value)
40 }))
41 }
42 }
43 }
44
45 /// Get boolean result for EXISTS operations
46 pub fn as_boolean(&self) -> Option<bool> {

Callers

nothing calls this directly

Calls 2

containsMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected