From 3082593fccfed7c99fd7779eff6a115bcd48a386 Mon Sep 17 00:00:00 2001 From: NikVolf Date: Fri, 11 Oct 2019 08:50:44 +0300 Subject: [PATCH] add intented use of the api --- src/tree.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tree.rs b/src/tree.rs index d1bf936..65e0220 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -8,10 +8,15 @@ use crate::{Entry, EntryLink, NodeData, Error, EntryKind}; /// With only some of the leaves/nodes pre-loaded / pre-generated. /// Exact amount of the loaded data can be calculated by the constructing party, /// depending on the length of the tree and maximum amount of operations that are going -/// to happen after construction. +/// to happen after construction. `Tree` should not be used as self-contained data structure, +/// since it's internal state can grow indefinitely after serial operations. +/// Intended use of this `Tree` is to instantiate it based on partially loaded data (see example +/// how to pick right nodes from the array representation of MMR Tree), perform several operations +/// (append-s/delete-s) and then drop it. pub struct Tree { stored: HashMap, + // This can grow indefinitely if `Tree` is misused as a self-contained data structure generated: Vec, // number of persistent(!) tree entries