co_primitives/types/storage.rs
1// SPDX-License-Identifier: AGPL-3.0-only
2// Copyright (C) 2026 1io BRANDGUARDIAN GmbH
3
4use crate::Block;
5use cid::Cid;
6
7/// Storage interface.
8pub trait Storage {
9 /// Returns a block from storage.
10 fn get(&self, cid: &Cid) -> Block;
11
12 /// Inserts a block into storage.
13 fn set(&mut self, block: Block) -> Cid;
14}