near_sdk/utils/
storage_key_impl.rs1pub trait IntoStorageKey {
7 fn into_storage_key(self) -> Vec<u8>;
9}
10
11impl IntoStorageKey for Vec<u8> {
12 #[inline]
13 fn into_storage_key(self) -> Vec<u8> {
14 self
15 }
16}
17
18impl<'a> IntoStorageKey for &'a [u8] {
19 #[inline]
20 fn into_storage_key(self) -> Vec<u8> {
21 self.to_vec()
22 }
23}
24
25impl<'a> IntoStorageKey for &'a [u8; 1] {
26 #[inline]
27 fn into_storage_key(self) -> Vec<u8> {
28 self.to_vec()
29 }
30}
31
32impl IntoStorageKey for u8 {
33 #[inline]
34 fn into_storage_key(self) -> Vec<u8> {
35 vec![self]
36 }
37}