CSVAsyncDecoder

public final class CSVAsyncDecoder

A decoder for decoding sections of a CSV document at different times.

You can get an instance of CSVAsyncDecoder from the CSVDecoder.async(for:length_:) method.

  • Decodes a section of a CSV document to instances of the registered Decodable type.

    When a whole row has been parsed from the data passed in, it is decoded and passed into the .onInstance callback that is registered.

    Note

    Each chunk of data passed in is assumed to come directly after the previous one passed in. The chunks may not be passed in out of order.

    Throws

    Errors that occur during the decoding process.

    Declaration

    Swift

    public func decode<C>(_ data: C) throws where C: Collection, C.Element == UInt8

    Parameters

    data

    A section of the CSV document to decode.