jsonUTF8Bytes
Declaration
func jsonUTF8Bytes<Bytes>(options: JSONEncodingOptions = JSONEncodingOptions()) throws -> Bytes where Bytes : SwiftProtobufContiguousBytes
Summary
Returns
A SwiftProtobufContiguousBytes containing the JSON serialization of the message.
Throws
SwiftProtobufErrororJSONEncodingErrorif encoding fails.
Parameters
| Name | Type | Summary |
|---|---|---|
| options | JSONEncodingOptions | The JSONEncodingOptions to use. |
Overload
static func jsonUTF8Bytes<C, Bytes>(from collection: C, options: JSONEncodingOptions = JSONEncodingOptions()) throws -> Bytes where Self == C.Element, C : Collection, Bytes : SwiftProtobufContiguousBytes
Summary
Returns a SwiftProtobufContiguousBytes containing the UTF-8 JSON serialization of the messages.
Unlike binary encoding, presence of required fields is not enforced when
serializing to JSON.
Returns
A SwiftProtobufContiguousBytes containing the JSON serialization of the messages.
Throws
SwiftProtobufErrororJSONEncodingErrorif encoding fails.
Parameters
| Name | Type | Summary |
|---|---|---|
| options | JSONEncodingOptions | The JSONEncodingOptions to use. |
Returns a
SwiftProtobufContiguousBytescontaining the UTF-8 JSON serialization of the message.Unlike binary encoding, presence of required fields is not enforced when
serializing to JSON.