summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-04-05 12:14:04 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-04-05 12:14:05 +0200
commit7641388216802ba578a5f14c1ad50dae1b0ce5c2 (patch)
tree23e8c0b5ba375295f0da6435da24703f27cf847a
parent69bd12bc78b1dbf60c911016c1a475ab2de4fa16 (diff)
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 <mail@beyermatthias.de>
-rw-r--r--src/async_dag.rs8
1 files changed, 8 insertions, 0 deletions
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<Id, N, Backend> AsyncDag<Id, N, Backend>
&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<bool> {
self.stream()