Trait Any

Source
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§

Source

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());

Implementations on Foreign Types§

Source§

impl<T: Any> Any for Option<T>

Source§

fn is_any(&self) -> bool

Source§

impl<T: Any> Any for &T

Source§

fn is_any(&self) -> bool

Source§

impl<T: Any> Any for Box<T>

Source§

fn is_any(&self) -> bool

Source§

impl<T: Any> Any for Rc<T>

Source§

fn is_any(&self) -> bool

Source§

impl<T: Any> Any for Arc<T>

Source§

fn is_any(&self) -> bool

Implementors§