pub fn from_reader(reader: R, config: RecordReaderConfig) -> Self
    where
        R: 'static + Unpin + Send,
    {
        let RecordReaderConfig { check_integrity } = config;

        let stream = futures::stream::try_unfold(reader, move |mut reader| async move {
            let bytes = crate::io::r#async::try_read_record(&mut reader, check_integrity).await?;
            let record = bytes.map(T::from_bytes).transpose()?;
            Ok(record.map(|record| (record, reader)))
        })
        .boxed();

        Self {
            stream,
            _phantom: PhantomData,
        }
    }
/// Load records from a reader type with [AsyncRead] trait.
Load records from a reader type with [AsyncRead] trait.
Load records from a reader type with [ AsyncRead ] trait .
pub fn from_reader(reader: R, config: RecordReaderConfig) -> Self
    where
        R: 'static + Unpin + Send,
    {
        let RecordReaderConfig { check_integrity } = config;
        let stream = futures::stream::try_unfold(reader, move |mut reader| async move {
            let bytes = crate::io::r#async::try_read_record(&mut reader, check_integrity).await?;
            let record = bytes.map(T::from_bytes).transpose()?;
            Ok(record.map(|record| (record, reader)))
        })
        .boxed();
        Self {
            stream,
            _phantom: PhantomData,
        }
    }
pub fn from_reader ( reader : R , config : RecordReaderConfig ) -> Self where R : ' static + Unpin + Send , { let RecordReaderConfig { check_integrity } = config ; let stream = futures :: stream :: try_unfold ( reader , move | mut reader | async move { let bytes = crate :: io :: r#async :: try_read_record ( & mut reader , check_integrity ) . await ? ; let record = bytes . map ( T :: from_bytes ) . transpose ( ) ? ; Ok ( record . map ( | record | ( record , reader ) ) ) } ) . boxed ( ) ; Self { stream , _phantom : PhantomData , } }
Load records from a reader type with [AsyncRead] trait.
Load records from a reader type with [ AsyncRead ] trait .
reader
R
config
RecordReaderConfig
reader
R
config
RecordReaderConfig