/// Infer the fields of a JSON file by reading the first n records of the file, with
/// `max_read_records` controlling the maximum number of records to read.
///
/// If `max_read_records` is not set, the whole file is read to infer its field types.
///
/// Contrary to [`infer_json_schema`], this function will seek back to the start of the `reader`.
/// That way, the `reader` can be used immediately afterwards.
///
/// # Examples
/// ```
/// use std::fs::File;
/// use std::io::{BufReader, Cursor};
/// use arrow2::io::json::infer_json_schema_from_seekable;
///
/// let data = r#"{"a":1, "b":[2.0, 1.3, -6.1], "c":[false, true], "d":4.1}
/// {"a":-10, "b":[2.0, 1.3, -6.1], "c":null, "d":null}
/// {"a":2, "b":[2.0, null, -6.1], "c":[false, null], "d":"text"}
/// {"a":3, "b":4, "c": true, "d":[1, false, "array", 2.4]}
/// "#;
/// let mut reader = BufReader::new(Cursor::new(data));
/// let inferred_schema = infer_json_schema_from_seekable(&mut reader, None).unwrap();
/// // cursor's position automatically set at 0
/// ```
Infer the fields of a JSON file by reading the first n records of the file, with
`max_read_records` controlling the maximum number of records to read.

If `max_read_records` is not set, the whole file is read to infer its field types.

Contrary to [`infer_json_schema`], this function will seek back to the start of the `reader`.
That way, the `reader` can be used immediately afterwards.
Infer the fields of a JSON file by reading the first n records of the file with ` max_read_records ` controlling the maximum number of records to read . If ` max_read_records ` is not set the whole file is read to infer its field types . Contrary to [ ` infer_json_schema ` ] this function will seek back to the start of the ` reader ` . That way the ` reader ` can be used immediately afterwards .
pub fn infer_json_schema_from_seekable<R: Read + Seek>(
    reader: &mut BufReader<R>,
    max_read_records: Option<usize>,
) -> Result<Schema> {
    let schema = infer_json_schema(reader, max_read_records);
    // return the reader seek back to the start
    reader.seek(SeekFrom::Start(0))?;
    schema
}
pub fn infer_json_schema_from_seekable < R : Read + Seek > ( reader : & mut BufReader < R > , max_read_records : Option < usize > , ) -> Result < Schema > { let schema = infer_json_schema ( reader , max_read_records ) ; // return the reader seek back to the start reader . seek ( SeekFrom :: Start ( 0 ) ) ? ; schema }
Infer the fields of a JSON file by reading the first n records of the file, with
`max_read_records` controlling the maximum number of records to read.
Infer the fields of a JSON file by reading the first n records of the file with ` max_read_records ` controlling the maximum number of records to read .
reader
&mut BufReader<R>
max_read_records
Option<usize>
examples
```
use std::fs::File;
use std::io::{BufReader, Cursor};
use arrow2::io::json::infer_json_schema_from_seekable.


` ` ` use std :: fs :: File ; use std :: io :: { BufReader Cursor } ; use arrow2 :: io :: json :: infer_json_schema_from_seekable .