@@ -275,7 +275,7 @@ fn trace_elem<T>(res: Result<T>, index: usize, position: usize) -> Result<T> {
275
275
}
276
276
277
277
#[ derive( Debug , Clone , PartialEq , Eq ) ]
278
- pub struct VerifierOptions {
278
+ pub struct VerifierOptions < ' a > {
279
279
/// Maximum depth of nested tables allowed in a valid flatbuffer.
280
280
pub max_depth : usize ,
281
281
/// Maximum number of tables allowed in a valid flatbuffer.
@@ -289,16 +289,20 @@ pub struct VerifierOptions {
289
289
// probably want an option to ignore utf8 errors since strings come from c++
290
290
// options to error un-recognized enums and unions? possible footgun.
291
291
// Ignore nested flatbuffers, etc?
292
+
293
+ /// The name of the table to use as the root table instead of the schema root.
294
+ pub root_table_name : Option < & ' a str > ,
292
295
}
293
296
294
- impl Default for VerifierOptions {
297
+ impl Default for VerifierOptions < ' _ > {
295
298
fn default ( ) -> Self {
296
299
Self {
297
300
max_depth : 64 ,
298
301
max_tables : 1_000_000 ,
299
302
// size_ might do something different.
300
303
max_apparent_size : 1 << 31 ,
301
304
ignore_missing_null_terminator : false ,
305
+ root_table_name : None ,
302
306
}
303
307
}
304
308
}
@@ -307,7 +311,7 @@ impl Default for VerifierOptions {
307
311
#[ derive( Debug ) ]
308
312
pub struct Verifier < ' opts , ' buf > {
309
313
buffer : & ' buf [ u8 ] ,
310
- opts : & ' opts VerifierOptions ,
314
+ opts : & ' opts VerifierOptions < ' opts > ,
311
315
depth : usize ,
312
316
num_tables : usize ,
313
317
apparent_size : usize ,
0 commit comments