From 2d25173aeafe9357f7cbd5c1edf6225d9ccf1114 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Tue, 25 Jun 2019 20:45:15 +0200 Subject: Rewrite Repository trait to fit needs better Signed-off-by: Matthias Beyer --- src/repository.rs | 7 ++----- 1 file 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; - type Get: Future; - /// It should be trivial to get the Id of a Node. - fn get(id: ID) -> Result - where ID: id::Id; + fn get(&self, id: Self::Id) -> Box>; } -- cgit v1.2.3