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 valueHashSet<T>: Tests if the element is a member of the setHashMap<K, V>: Tests if a key exists in the mapString: Tests for substring (&str) or character (char) presenceORSet<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.
Implementations on Foreign Types§
Source§impl LogosContains<&str> for String
impl LogosContains<&str> for String
fn logos_contains(&self, value: &&str) -> bool
Source§impl LogosContains<char> for String
impl LogosContains<char> for String
fn logos_contains(&self, value: &char) -> bool
Source§impl LogosContains<String> for String
impl LogosContains<String> for String
fn logos_contains(&self, value: &String) -> bool
Source§impl<T: Eq + Hash, S: BuildHasher> LogosContains<T> for IndexSet<T, S>
impl<T: Eq + Hash, S: BuildHasher> LogosContains<T> for IndexSet<T, S>
fn logos_contains(&self, value: &T) -> bool
Source§impl<T: PartialEq> LogosContains<T> for [T]
impl<T: PartialEq> LogosContains<T> for [T]
fn logos_contains(&self, value: &T) -> bool
Source§impl<T: PartialEq> LogosContains<T> for Vec<T>
impl<T: PartialEq> LogosContains<T> for Vec<T>
fn logos_contains(&self, value: &T) -> bool
Implementors§
impl LogosContains<i64> for LogosDenseI64Map
impl LogosContains<i64> for LogosDenseI64Set
impl LogosContains<i64> for LogosI32Map
impl LogosContains<i64> for LogosI32Set
impl LogosContains<i64> for LogosI64Map
impl LogosContains<i64> for LogosI64Set
impl<K: Eq + Hash, V> LogosContains<K> for LogosMap<K, V>
impl<K: Eq + Hash, V> LogosContains<K> for FxHashMap<K, V>
impl<K: Hash + Eq + Clone, V: Merge + Default + Clone> LogosContains<K> for ORMap<K, V>
m contains key — observed-remove key membership.