@@ -111,6 +111,71 @@ pub trait Read<'de>: private::Sealed {
111
111
fn set_failed ( & mut self , failed : & mut bool ) ;
112
112
}
113
113
114
+ impl < ' de , R : Read < ' de > > private:: Sealed for & mut R { }
115
+ impl < ' de , R : Read < ' de > > Read < ' de > for & mut R {
116
+ fn next ( & mut self ) -> Result < Option < u8 > > {
117
+ R :: next ( self )
118
+ }
119
+
120
+ fn peek ( & mut self ) -> Result < Option < u8 > > {
121
+ R :: peek ( self )
122
+ }
123
+
124
+ fn discard ( & mut self ) {
125
+ R :: discard ( self )
126
+ }
127
+
128
+ fn position ( & self ) -> Position {
129
+ R :: position ( self )
130
+ }
131
+
132
+ fn peek_position ( & self ) -> Position {
133
+ R :: peek_position ( self )
134
+ }
135
+
136
+ fn byte_offset ( & self ) -> usize {
137
+ R :: byte_offset ( self )
138
+ }
139
+
140
+ fn parse_str < ' s > ( & ' s mut self , scratch : & ' s mut Vec < u8 > ) -> Result < Reference < ' de , ' s , str > > {
141
+ R :: parse_str ( self , scratch)
142
+ }
143
+
144
+ fn parse_str_raw < ' s > (
145
+ & ' s mut self ,
146
+ scratch : & ' s mut Vec < u8 > ,
147
+ ) -> Result < Reference < ' de , ' s , [ u8 ] > > {
148
+ R :: parse_str_raw ( self , scratch)
149
+ }
150
+
151
+ fn ignore_str ( & mut self ) -> Result < ( ) > {
152
+ R :: ignore_str ( self )
153
+ }
154
+
155
+ fn decode_hex_escape ( & mut self ) -> Result < u16 > {
156
+ R :: decode_hex_escape ( self )
157
+ }
158
+
159
+ #[ cfg( feature = "raw_value" ) ]
160
+ fn begin_raw_buffering ( & mut self ) {
161
+ R :: begin_raw_buffering ( self )
162
+ }
163
+
164
+ #[ cfg( feature = "raw_value" ) ]
165
+ fn end_raw_buffering < V > ( & mut self , visitor : V ) -> Result < V :: Value >
166
+ where
167
+ V : Visitor < ' de > ,
168
+ {
169
+ R :: end_raw_buffering ( self , visitor)
170
+ }
171
+
172
+ const should_early_return_if_failed: bool = R :: should_early_return_if_failed;
173
+
174
+ fn set_failed ( & mut self , failed : & mut bool ) {
175
+ R :: set_failed ( self , failed)
176
+ }
177
+ }
178
+
114
179
pub struct Position {
115
180
pub line : usize ,
116
181
pub column : usize ,
0 commit comments