Skip to content

Protocol

ContentEncoder

Conform a type to this protocol to make it usable for encoding data via Vapor’s ContentConfiguration system.
protocol ContentEncoder : Sendable

Topics

Instance Methods

  • encode(_:to:headers:)
    Legacy “encode object” method. The provided encodable object’s contents must be stored in the provided NIOCore/ByteBuffer, and any appropriate headers for the type of the content may be stored in the provided HTTPHeaders.
  • encode(_:to:headers:userInfo:)
    “Encode object” method. The provided encodable object’s contents must be stored in the provided NIOCore/ByteBuffer, and any appropriate headers for the type of the content may be stored in the provided HTTPHeaders objects. The provided userInfo dictionary must be forwarded to the underlying Swift/Encoder used to perform the encoding operation.

Relationships

Inherits From

  • Swift.Sendable
  • Swift.SendableMetatype

Conforming Types