Skip to main content

lsm_tree/
any_tree.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2024-present, fjall-rs
3// Copyright (c) 2026-present, Structured World Foundation
4
5use crate::{BlobTree, Tree};
6use enum_dispatch::enum_dispatch;
7
8/// May be a standard [`Tree`] or a [`BlobTree`]
9#[derive(Clone)]
10#[enum_dispatch(AbstractTree)]
11pub enum AnyTree {
12    /// Standard LSM-tree, see [`Tree`]
13    Standard(Tree),
14
15    /// Key-value separated LSM-tree, see [`BlobTree`]
16    Blob(BlobTree),
17}
18
19impl crate::abstract_tree::sealed::Sealed for AnyTree {}