Skip to main content

Query

Trait Query 

Source
pub trait Query {
    // Required method
    fn key(&self, kind: IndexKind) -> Option<Key>;
}
Expand description

A value that can be an index key.

Separate from Field because a lookup takes the borrowed form, the same way HashMap::get does, so a String field is searched with &str and not with a String built for the length of one call.

Required Methods§

Source

fn key(&self, kind: IndexKind) -> Option<Key>

The key this value is filed under in an index of kind, or None if an index of that kind does not file this type at all.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Query for String

Source§

fn key(&self, kind: IndexKind) -> Option<Key>

Source§

impl Query for bool

Source§

fn key(&self, _kind: IndexKind) -> Option<Key>

Source§

impl Query for f32

Source§

fn key(&self, _kind: IndexKind) -> Option<Key>

Source§

impl Query for f64

Source§

fn key(&self, _kind: IndexKind) -> Option<Key>

Source§

impl Query for i8

Source§

fn key(&self, _kind: IndexKind) -> Option<Key>

Source§

impl Query for i16

Source§

fn key(&self, _kind: IndexKind) -> Option<Key>

Source§

impl Query for i32

Source§

fn key(&self, _kind: IndexKind) -> Option<Key>

Source§

impl Query for i64

Source§

fn key(&self, _kind: IndexKind) -> Option<Key>

Source§

impl Query for str

The borrowed form, so a String field is searched with a &str.

Source§

fn key(&self, kind: IndexKind) -> Option<Key>

Source§

impl Query for u8

Source§

fn key(&self, _kind: IndexKind) -> Option<Key>

Source§

impl Query for u16

Source§

fn key(&self, _kind: IndexKind) -> Option<Key>

Source§

impl Query for u32

Source§

fn key(&self, _kind: IndexKind) -> Option<Key>

Source§

impl Query for u64

Source§

fn key(&self, _kind: IndexKind) -> Option<Key>

Implementors§