From 7641388216802ba578a5f14c1ad50dae1b0ce5c2 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Mon, 5 Apr 2021 12:14:04 +0200 Subject: Add getters for backend This is necessary if the user wants to talk to the backend without working with the DAG. Signed-off-by: Matthias Beyer --- src/async_dag.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/async_dag.rs b/src/async_dag.rs index 85b1f9e..57ecc16 100644 --- a/src/async_dag.rs +++ b/src/async_dag.rs @@ -69,6 +69,14 @@ impl AsyncDag &self.head } + pub fn backend(&self) -> &Backend { + &self.backend + } + + pub fn backend_mut(&mut self) -> &mut Backend { + &mut self.backend + } + /// Check whether an `id` is in the DAG. pub async fn has_id(&self, id: &Id) -> Result { self.stream() -- cgit v1.2.3