DataConvertible

public protocol DataConvertible

A type to transform Data to Self of conforming instance.

  • Returns Self of caller instance type if possible from Data, otherwise throws.

    Throws

    An DataConversionError error instance.

    Declaration

    Swift

    static func convert(from data: Data) throws -> Self

    Return Value

    The Self initialized with Data.

  • convert(from:) Extension method

    Returns Self of caller instance type if possible from Data, otherwise throws.

    Throws

    An DataConversionError error instance.

    Declaration

    Swift

    static func convert(from data: Data? = nil) throws -> Self

    Return Value

    The Self initialized with Data.