Optional

extension Optional: XDREncodable where Wrapped: XDRCodable

Extension making Optional types XDR-encodable.

Optionals in XDR are encoded as a 32-bit boolean flag (0 or 1) followed by the value if present.

Available where Wrapped: XDRCodable

  • Encodes an optional value to XDR format.

    Writes 0 if nil, or 1 followed by the wrapped value if present.

    Declaration

    Swift

    public func xdrEncode(to encoder: XDREncoder) throws