SyncSerializer

public struct SyncSerializer

A synchronous wrapper for the Serializer struct for parsing a whole CSV document.

  • Creates a new SyncSerializer instance.

    Declaration

    Swift

    public init (configuration: Config = Config.default)

    Parameters

    configuration

    The serilization options for the SyncSerializer instance.

  • Serializes a dictionary to CSV document data. Usually this will be a dictionary of type `[BytesRepresentable: [BytesRepresentable]], but it can be any type you conform to the proper protocols.

    Note

    When you pass a dictionary into this method, each value collection is expect to contain the same number of elements, and will crash with index out of bounds if that assumption is broken.

    Declaration

    Swift

    public func serialize<Data>(_ data: Data) -> [UInt8] where
        Data: KeyedCollection, Data.Key: BytesRepresentable, Data.Value: Collection, Data.Value.Element: BytesRepresentable,
        Data.Value.Index: Strideable, Data.Value.Index.Stride: SignedInteger

    Parameters

    data

    The dictionary (or other object) to parse.

    Return Value

    The serialized CSV data.