@@ -41,23 +41,25 @@ impl<'a> PrefixedStorage<'a> {
4141 prefix : to_length_prefixed_nested ( namespaces) ,
4242 }
4343 }
44+ }
4445
45- pub fn get ( & self , key : & [ u8 ] ) -> Option < Vec < u8 > > {
46+ impl < ' a > Storage for PrefixedStorage < ' a > {
47+ fn get ( & self , key : & [ u8 ] ) -> Option < Vec < u8 > > {
4648 get_with_prefix ( self . storage , & self . prefix , key)
4749 }
4850
49- pub fn set ( & mut self , key : & [ u8 ] , value : & [ u8 ] ) {
51+ fn set ( & mut self , key : & [ u8 ] , value : & [ u8 ] ) {
5052 set_with_prefix ( self . storage , & self . prefix , key, value) ;
5153 }
5254
53- pub fn remove ( & mut self , key : & [ u8 ] ) {
55+ fn remove ( & mut self , key : & [ u8 ] ) {
5456 remove_with_prefix ( self . storage , & self . prefix , key) ;
5557 }
5658
5759 #[ cfg( feature = "iterator" ) ]
5860 /// range allows iteration over a set of keys, either forwards or backwards
5961 /// uses standard rust range notation, and eg db.range(b"foo"..b"bar") also works reverse
60- pub fn range < ' b > (
62+ fn range < ' b > (
6163 & ' b self ,
6264 start : Option < & [ u8 ] > ,
6365 end : Option < & [ u8 ] > ,
@@ -88,14 +90,24 @@ impl<'a> ReadonlyPrefixedStorage<'a> {
8890 prefix : to_length_prefixed_nested ( namespaces) ,
8991 }
9092 }
93+ }
9194
92- pub fn get ( & self , key : & [ u8 ] ) -> Option < Vec < u8 > > {
95+ impl < ' a > Storage for ReadonlyPrefixedStorage < ' a > {
96+ fn get ( & self , key : & [ u8 ] ) -> Option < Vec < u8 > > {
9397 get_with_prefix ( self . storage , & self . prefix , key)
9498 }
9599
100+ fn set ( & mut self , _key : & [ u8 ] , _value : & [ u8 ] ) {
101+ unimplemented ! ( ) ;
102+ }
103+
104+ fn remove ( & mut self , _key : & [ u8 ] ) {
105+ unimplemented ! ( ) ;
106+ }
107+
96108 #[ cfg( feature = "iterator" ) ]
97109 /// range allows iteration over a set of keys, either forwards or backwards
98- pub fn range < ' b > (
110+ fn range < ' b > (
99111 & ' b self ,
100112 start : Option < & [ u8 ] > ,
101113 end : Option < & [ u8 ] > ,
0 commit comments