pub trait Any {
// Required method
fn is_any(&self) -> bool;
}
Expand description
A trait that types can implement in order to support #[venndb(any)]
attribute filters.
Required Methods§
Sourcefn is_any(&self) -> bool
fn is_any(&self) -> bool
Returns true if the value is considered to be “any” within the context of the type.
§Example
use venndb::Any;
#[derive(Debug)]
struct MyString(String);
impl Any for MyString {
fn is_any(&self) -> bool {
self.0 == "*"
}
}
let my_string = MyString("*".to_string());
assert!(my_string.is_any());
let my_string = MyString("hello".to_string());
assert!(!my_string.is_any());