MCPcopy Create free account
hub / github.com/apache/arrow-rs / read_header_info

Function read_header_info

arrow-avro/src/reader/async_reader/builder.rs:125–136  ·  view source on GitHub ↗

Reads the Avro file header (magic, metadata, sync marker) asynchronously from `reader`. On success, returns the parsed [`HeaderInfo`] containing the header and its length in bytes.

(
    reader: &mut R,
    file_size: u64,
    header_size_hint: Option<u64>,
)

Source from the content-addressed store, hash-verified

123///
124/// On success, returns the parsed [`HeaderInfo`] containing the header and its length in bytes.
125pub async fn read_header_info<R>(
126 reader: &mut R,
127 file_size: u64,
128 header_size_hint: Option<u64>,
129) -> Result<HeaderInfo, AvroError>
130where
131 R: AsyncFileReader,
132{
133 read_header(reader, file_size, header_size_hint)
134 .await
135 .map(|(header, header_len)| HeaderInfo::new(header, header_len))
136}
137
138async fn read_header<R>(
139 reader: &mut R,

Callers 2

try_buildMethod · 0.70

Calls 1

read_headerFunction · 0.70

Tested by 1