From 1e232f50f5bc99ebda6704ca9f5d6c93b70f24c1 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Mon, 6 Jul 2020 09:14:03 +0200 Subject: [PATCH] Switch to iterators --- src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 4133c0f..caaff15 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -102,14 +102,14 @@ pub trait RecordFields { // semantic order pub trait Indexed { /// Retrieve all records matching the key. - fn find(&self, key: &K) -> Vec<&R>; + fn find<'i>(&'i self, key: &K) -> Box + 'i>; /// Retrieve all records matching in the key range defined by /// `start` and `end`. /// /// * `start` is included // TODO: TBC for `end` - fn find_range(&self, start: &K, end: &K) -> Vec<&R>; + fn find_range<'i>(&'i self, start: &K, end: &K) -> Box + 'i>; } /// Methods provided by destructuring indices. @@ -121,12 +121,12 @@ pub trait Indexed { /// * `K`: Type of the keys pub trait IndexedDestructured { /// Retrieve all records matching the key. - fn find(&self, key: &K) -> Vec<&F>; + fn find<'i>(&'i self, key: &K) -> Box + 'i>; /// Retrieve all records matching in the key range defined by /// `start` and `end`. /// /// * `start` is included // TODO: TBC for `end` - fn find_range(&self, start: &K, end: &K) -> Vec<(K, &F)>; + fn find_range<'i>(&'i self, start: &K, end: &K) -> Box + 'i>; }