pub fn load_reader_async<R>(
    reader: R,
    config: RecordIndexerConfig,
) -> impl Stream<Item = Result<Position>>
where
    R: AsyncRead + AsyncSeek + Unpin,
{
    let RecordIndexerConfig { check_integrity } = config;

    stream::try_unfold(reader, move |mut reader| async move {
        let len = match crate::io::r#async::try_read_len(&mut reader, check_integrity).await? {
            Some(len) => len,
            None => return Ok(None),
        };

        let offset = reader.seek(SeekFrom::Current(0)).await?;
        skip_or_check(&mut reader, len, check_integrity).await?;

        let pos = Position { offset, len };
        Result::<_, Error>::Ok(Some((pos, reader)))
    })
}
/// Load record indexes from a reader.
Load record indexes from a reader.
Load record indexes from a reader .
pub fn load_reader_async<R>(
    reader: R,
    config: RecordIndexerConfig,
) -> impl Stream<Item = Result<Position>>
where
    R: AsyncRead + AsyncSeek + Unpin,
{
    let RecordIndexerConfig { check_integrity } = config;
    stream::try_unfold(reader, move |mut reader| async move {
        let len = match crate::io::r#async::try_read_len(&mut reader, check_integrity).await? {
            Some(len) => len,
            None => return Ok(None),
        };
        let offset = reader.seek(SeekFrom::Current(0)).await?;
        skip_or_check(&mut reader, len, check_integrity).await?;
        let pos = Position { offset, len };
        Result::<_, Error>::Ok(Some((pos, reader)))
    })
}
pub fn load_reader_async < R > ( reader : R , config : RecordIndexerConfig , ) -> impl Stream < Item = Result < Position > > where R : AsyncRead + AsyncSeek + Unpin , { let RecordIndexerConfig { check_integrity } = config ; stream :: try_unfold ( reader , move | mut reader | async move { let len = match crate :: io :: r#async :: try_read_len ( & mut reader , check_integrity ) . await ? { Some ( len ) => len , None => return Ok ( None ) , } ; let offset = reader . seek ( SeekFrom :: Current ( 0 ) ) . await ? ; skip_or_check ( & mut reader , len , check_integrity ) . await ? ; let pos = Position { offset , len } ; Result :: < _ , Error > :: Ok ( Some ( ( pos , reader ) ) ) } ) }
Load record indexes from a reader.
Load record indexes from a reader .
reader
R
config
RecordIndexerConfig
reader
R
config
RecordIndexerConfig