Protocols

The following protocols are available globally.

  • A type serving as a witness to another type’s conformance to Equatable.

    See more

    Declaration

    Swift

    public protocol EquatableWitness<Element>
  • Classes whose initializers actually create derived classes

    See more

    Declaration

    Swift

    public protocol FactoryInitializable : Sendable
  • A type serving as a witness to another type’s conformance to Hashable.

    See more

    Declaration

    Swift

    public protocol HashableWitness<Element> : EquatableWitness
  • An object that flattens values into—or reconstitutes values from—a serialized Encoding, maintaining state across the (de)serialization of individual parts.

    Note

    this protocol matches Foundation’s XXXEncoder/XXXDecoder types, which—confusingly—do not themselves conform to the Encoder/Decoder protocols.
    See more

    Declaration

    Swift

    public protocol StatefulCoder
  • An object that flattens values into a serialized Encoding, maintaining state across the serialization of individual parts.

    Note

    this protocol matches Foundation’s XXXEncoder types, which—confusingly—do not themselves conform to the Encoder protocol.
    See more

    Declaration

    Swift

    public protocol StatefulEncoder : StatefulCoder
  • An object that reconstitutes values from a serialized Encoding, maintaining state across the deserialization of individual parts.

    Note

    this protocol matches Foundation’s XXXEncoder types, which—confusingly—do not themselves conform to the Encoder protocol.
    See more

    Declaration

    Swift

    public protocol StatefulDecoder : StatefulCoder