Skip to main content

midnight_storage_core/
lib.rs

1// This file is part of midnight-ledger.
2// Copyright (C) Midnight Foundation
3// SPDX-License-Identifier: Apache-2.0
4// Licensed under the Apache License, Version 2.0 (the "License");
5// You may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7// http://www.apache.org/licenses/LICENSE-2.0
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14#![deny(unreachable_pub)]
15//#![deny(warnings)]
16#![cfg_attr(not(feature = "public-internal-structure"), deny(missing_docs))]
17//! Merkle-ized data structures and persistent disk storage.
18//!
19//! This crate provides storage primitives, primarily maps, for use
20//! in larger data structures. It also exposes its deduplicated memory arena,
21//! [`Arena`](arena::Arena), and pointers within it, [`Sp`](arena::Sp).
22
23pub mod arena;
24pub mod backend;
25pub mod db;
26pub mod storable;
27pub mod storage;
28
29pub use macros::Storable;
30pub use storable::{Storable, WellBehavedHasher};
31pub use storage::Storage;
32
33mod cache;
34
35#[cfg(feature = "gc-v1")]
36mod gc;
37#[cfg(feature = "test-utilities")]
38pub mod test;
39
40/// The default storage mechanism.
41pub type DefaultHasher = sha2::Sha256;
42/// The default database.
43pub type DefaultDB = db::InMemoryDB<DefaultHasher>;