pub async fn wait(mut self) -> Option<AsyncTreeReader> {
        loop {
            if let Some(reader) = self.0.borrow().clone() {
                break Some(reader);
            }
            self.0.changed().await.ok()?;
        }
    }
Waits until the tree is initialized and returns a reader for it. If the tree is dropped before
getting initialized, returns `None`.
core/node/metadata_calculator/src/helpers.rs