summaryrefslogtreecommitdiffstats
path: root/src/repository.rs
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2019-06-25 20:45:15 +0200
committerMatthias Beyer <mail@beyermatthias.de>2019-06-25 20:46:36 +0200
commit2d25173aeafe9357f7cbd5c1edf6225d9ccf1114 (patch)
tree2c393e1d7dc554d494a6848203f3e1e6feee53fe /src/repository.rs
parentdaa109df7499490ff07bfe6bb19b3a7b83e50b78 (diff)
Rewrite Repository trait to fit needs better
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'src/repository.rs')
-rw-r--r--src/repository.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/repository.rs b/src/repository.rs
index 57f2d63..245b2e4 100644
--- a/src/repository.rs
+++ b/src/repository.rs
@@ -12,15 +12,12 @@ use crate::id;
use futures::future::Future;
///
-pub trait Repository: Debug {
+pub trait Repository: Debug + Sync + Send {
type Id: id::Id;
type Error: Debug;
type Node: node::Node<Id = Self::Id, Error = Self::Error>;
- type Get: Future<Item = Self::Node, Error = Self::Error>;
-
/// It should be trivial to get the Id of a Node.
- fn get<ID>(id: ID) -> Result<Self::Get, Self::Error>
- where ID: id::Id;
+ fn get(&self, id: Self::Id) -> Box<Future<Item = Self::Node, Error = Self::Error>>;
}