pub trait LogosContains<T> {
// Required method
fn logos_contains(&self, value: &T) -> bool;
}Expand description
Unified containment testing for all collection types.
This trait provides a consistent logos_contains method across Logos’s
collection types, abstracting over the different containment semantics
of vectors (by value), sets (by membership), maps (by key), and
strings (by substring or character).
§Implementations
Vec<T>: Tests if the vector contains an element equal to the value- [
HashSet<T>]: Tests if the element is a member of the set - [
HashMap<K, V>]: Tests if a key exists in the map String: Tests for substring (&str) or character (char) presence- [
ORSet<T, B>]: Tests if the element is in the CRDT set
§Examples
use logicaffeine_data::LogosContains;
// Vector: contains by value equality
let v = vec![1, 2, 3];
assert!(v.logos_contains(&2));
assert!(!v.logos_contains(&5));
// String: contains by substring
let s = String::from("hello world");
assert!(s.logos_contains(&"world"));
// String: contains by character
assert!(s.logos_contains(&'o'));Required Methods§
Sourcefn logos_contains(&self, value: &T) -> bool
fn logos_contains(&self, value: &T) -> bool
Check if this collection contains the given value.