[][src]Trait retriever::traits::record::Record

pub trait Record<ChunkKey: ?Sized, ItemKey: ?Sized> where
    ChunkKey: ToOwned,
    ChunkKey::Owned: Clone,
    ItemKey: ToOwned,
    ItemKey::Owned: Clone
{ fn chunk_key(&self) -> Cow<ChunkKey>;
fn item_key(&self) -> Cow<ItemKey>; }

A trait for any retrievable Record. A Record must provide a chunk key and an item key. The combination of chunk key and item key must be unique for each Record. If you do not want to use chunking, you can use () as the chunk key.

Required methods

fn chunk_key(&self) -> Cow<ChunkKey>

Provide a chunk key for this Record. It's normal and expected for many related Records to share the same chunk key. Records with the same chunk key are stored physically together. It is easy to iterate over all Records in a single chunk, and it's possible to remove an entire chunk in constant time.

fn item_key(&self) -> Cow<ItemKey>

Provide a item key for this record. The item key must be unique within each chunk.

Loading content...

Implementations on Foreign Types

impl<'_, ChunkKey, ItemKey, R> Record<ChunkKey, ItemKey> for &'_ R where
    ChunkKey: ValidKey,
    ItemKey: ValidKey,
    R: Record<ChunkKey, ItemKey>, 
[src]

impl<ItemKey, R> Record<(), ItemKey> for (ItemKey, R) where
    ItemKey: ValidKey
[src]

impl<ChunkKey, ItemKey, R> Record<ChunkKey, ItemKey> for (ChunkKey, ItemKey, R) where
    ChunkKey: ValidKey,
    ItemKey: ValidKey
[src]

Loading content...

Implementors

impl<ChunkKey: ?Sized, ItemKey: ?Sized, C, I> Record<ChunkKey, ItemKey> for Id<C, I> where
    ChunkKey: BorrowedKey,
    ItemKey: BorrowedKey,
    ChunkKey::Owned: ValidKey + Borrow<ChunkKey>,
    ItemKey::Owned: ValidKey + Borrow<ItemKey>,
    C: ValidKey + Borrow<ChunkKey>,
    I: ValidKey + Borrow<ItemKey>, 
[src]

Loading content...