Skip to main content

reifydb_core/key/
config.rs

1// SPDX-License-Identifier: Apache-2.0
2// Copyright (c) 2026 ReifyDB
3
4use reifydb_codec::key::encoded::EncodedKey;
5use reifydb_macro::KeyCodec;
6
7use super::KeyTag;
8use crate::{
9	interface::catalog::config::ConfigKey,
10	key::{
11		any::{ByteEncoding, Field, KeyFields},
12		bound::TaggedKeyBoundRange,
13	},
14};
15
16#[derive(Debug, Clone, PartialEq, KeyCodec, Hash)]
17#[key(tag = ConfigStorage)]
18pub struct ConfigStorageKey {
19	#[key(display)]
20	pub key: ConfigKey,
21}
22
23impl ConfigStorageKey {
24	pub fn new(key: ConfigKey) -> Self {
25		Self {
26			key,
27		}
28	}
29
30	pub fn for_key(key: ConfigKey) -> EncodedKey {
31		Self::new(key).encode()
32	}
33
34	pub fn full_scan() -> TaggedKeyBoundRange {
35		TaggedKeyBoundRange::kind(Self::TAG)
36	}
37}