serializedBytes
Declaration
func serializedBytes<Bytes>(partial: Bool = false, options: BinaryEncodingOptions = BinaryEncodingOptions()) throws -> Bytes where Bytes : SwiftProtobufContiguousBytes
Summary
Returns
A SwiftProtobufContiguousBytes instance containing the binary serialization
of the message.
Throws
SwiftProtobufErrororBinaryEncodingErrorif encoding fails.
Parameters
| Name | Type | Summary |
|---|---|---|
| partial | Bool | If false (the default), this method will checkMessage.isInitialized before encoding to verify that all requiredfields are present. If any are missing, this method throws. BinaryEncodingError/missingRequiredFields. |
| options | BinaryEncodingOptions | The BinaryEncodingOptions to use. |
Returns a
SwiftProtobufContiguousBytesinstance containing the Protocol Buffer binaryformat serialization of the message.