Expand index trait to also include key type
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
@@ -22,7 +22,7 @@ where
|
||||
type Error: std::fmt::Debug;
|
||||
|
||||
/// Get all items where the given index field is equal to key.
|
||||
fn get<I>(&self, key: K) -> Result<Vec<V>, Error<Self::Error>>
|
||||
fn get<I>(&self, key: &I::Key) -> Result<Vec<V>, Error<Self::Error>>
|
||||
where
|
||||
I: Index<Model = V>;
|
||||
|
||||
@@ -33,7 +33,7 @@ where
|
||||
fn set(&self, value: &V) -> Result<(), Error<Self::Error>>;
|
||||
|
||||
/// Delete all items from the db with a given index.
|
||||
fn delete<I>(&self, key: K) -> Result<(), Error<Self::Error>>
|
||||
fn delete<I>(&self, key: &I::Key) -> Result<(), Error<Self::Error>>
|
||||
where
|
||||
I: Index<Model = V>;
|
||||
|
||||
@@ -66,4 +66,3 @@ impl<E> From<bincode::error::EncodeError> for Error<E> {
|
||||
Error::Encode(value)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user