diff --git a/Cargo.toml b/Cargo.toml index 3ee7e46..4e12693 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bibliographix" description = "A bibliography management crate." -version = "0.1.0" +version = "0.2.0" authors = ["trivernis "] edition = "2018" license = "Apache-2.0" diff --git a/src/bib_manager.rs b/src/bib_manager.rs index cbb1c35..aa9c0ba 100644 --- a/src/bib_manager.rs +++ b/src/bib_manager.rs @@ -24,6 +24,17 @@ impl BibManager { Arc::clone(&self.root_ref_anchor) } + /// Creates a new child BibManager with a child anchor and the parents entry dict + pub fn create_child(&self) -> BibManager { + let anchor = self.root_ref_anchor.lock().unwrap().create_anchor(); + let entry_dict = Arc::clone(&self.entry_dictionary); + + Self { + entry_dictionary: entry_dict, + root_ref_anchor: anchor, + } + } + /// Returns the reference to the entry dictionary pub fn entry_dictionary(&self) -> Arc> { Arc::clone(&self.entry_dictionary)