From e78f90fa9863cd5b22ab636a98204f9070261091 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 30 Oct 2019 13:05:47 +0000 Subject: [PATCH] Added Deref details --- text/0000-tangle/0000-tangle.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/text/0000-tangle/0000-tangle.md b/text/0000-tangle/0000-tangle.md index 9fd6f392..817fa797 100644 --- a/text/0000-tangle/0000-tangle.md +++ b/text/0000-tangle/0000-tangle.md @@ -39,7 +39,7 @@ let tx0_trunk_trunk = tangle As can be seen, walking the Tangle is unnecessarily explicit. -To address this issue we suggest a design that makes use of Rust's zero-cost approach to abstraction to transparently manipulate the Tangle using guard/reference types and the `Deref` trait. +To address this issue we suggest a design that makes use of Rust's zero-cost approach to abstraction to transparently manipulate the Tangle using guard/reference types and the `Deref` trait. The `Deref` trait permits a type to dereference to another, thereby allowing one to call the methods of the inner type on the wrapper type. The equivalent code using the proposed API abstraction: @@ -406,4 +406,4 @@ mod tests { # Unresolved questions -- How does the design of this Tangle API relate to the implementation of the storage database layer? Should we move to an async query model? \ No newline at end of file +- How does the design of this Tangle API relate to the implementation of the storage database layer? Should we move to an async query model?