# merge Source: https://www.nianticspatial.com/docs/api/swift/NSDK.Nsdk_Vps_DoubleArray.method-merge/ merge --- ## Declaration mutating func merge(from source: Self, fieldMask: Google_Protobuf_FieldMask, mergeOption: Google_Protobuf_FieldMask.MergeOptions = .init()) throws #### Summary Merges fields specified in a FieldMask into another message. ### Parameters | Name | Type | Summary | | --- | --- | --- | | bytes | Bytes | - | | extensions | (any ExtensionMap)? | An `ExtensionMap` used to look up and decode any extensions in this message or messages nested within this message's fields. | | partial | Bool | If `false` (the default), this method will check `Message/isInitialized-6abgi` after decoding to verify that all required fields are present. If any are missing, this method throws `BinaryDecodingError/missingRequiredFields`. | | options | BinaryDecodingOptions | The `BinaryDecodingOptions` to use. | --- ## Overload 1 mutating func merge(serializedBytes bytes: Bytes, extensions: (any ExtensionMap)? = nil, partial: Bool = false, options: BinaryDecodingOptions = BinaryDecodingOptions()) throws where Bytes : SwiftProtobufContiguousBytes #### Summary Updates the message by decoding the given SwiftProtobufContiguousBytes value containing a serialized message in Protocol Buffer binary format into the receiver. #### Throws BinaryDecodingError if decoding fails. > **Info:** > > **Notice** > > Note: If this method throws an error, the message may still have been ### Parameters | Name | Type | Summary | | --- | --- | --- | | bytes | Bytes | - | | extensions | (any ExtensionMap)? | An `ExtensionMap` used to look up and decode any extensions in this message or messages nested within this message's fields. | | partial | Bool | If `false` (the default), this method will check `Message/isInitialized-6abgi` after decoding to verify that all required fields are present. If any are missing, this method throws `BinaryDecodingError/missingRequiredFields`. | | options | BinaryDecodingOptions | The `BinaryDecodingOptions` to use. | --- ## Overload 2 mutating func merge(serializedBytes bytes: RawSpan, extensions: (any ExtensionMap)? = nil, partial: Bool = false, options: BinaryDecodingOptions = BinaryDecodingOptions()) throws #### Summary Updates the message by decoding the bytes provided by a RawSpan containing a serialized message in Protocol Buffer binary format into the receiver. #### Throws BinaryDecodingError if decoding fails. > **Info:** > > **Notice** > > Note: If this method throws an error, the message may still have been ### Parameters | Name | Type | Summary | | --- | --- | --- | | bytes | Bytes | - | | extensions | (any ExtensionMap)? | An `ExtensionMap` used to look up and decode any extensions in this message or messages nested within this message's fields. | | partial | Bool | If `false` (the default), this method will check `Message/isInitialized-6abgi` after decoding to verify that all required fields are present. If any are missing, this method throws `BinaryDecodingError/missingRequiredFields`. | | options | BinaryDecodingOptions | The `BinaryDecodingOptions` to use. | --- ## Overload 3 mutating func merge(contiguousBytes bytes: Bytes, extensions: (any ExtensionMap)? = nil, partial: Bool = false, options: BinaryDecodingOptions = BinaryDecodingOptions()) throws where Bytes : ContiguousBytes #### Summary Updates the message by decoding the given Foundation/ContiguousBytes value containing a serialized message in Protocol Buffer binary format into the receiver. #### Throws SwiftProtobufError if decoding fails. > **Info:** > > **Notice** > > Note: If this method throws an error, the message may still have been ### Parameters | Name | Type | Summary | | --- | --- | --- | | bytes | Bytes | - | | extensions | (any ExtensionMap)? | An `ExtensionMap` used to look up and decode any extensions in this message or messages nested within this message's fields. | | partial | Bool | If `false` (the default), this method will check `Message/isInitialized-6abgi` after decoding to verify that all required fields are present. If any are missing, this method throws `BinaryDecodingError/missingRequiredFields`. | | options | BinaryDecodingOptions | The `BinaryDecodingOptions` to use. | --- ## Overload 4 mutating func merge(serializedBytes bytes: Bytes, extensions: (any ExtensionMap)? = nil, partial: Bool = false, options: BinaryDecodingOptions = BinaryDecodingOptions()) throws where Bytes : ContiguousBytes #### Summary Updates the message by decoding the given Foundation/ContiguousBytes value containing a serialized message in Protocol Buffer binary format into the receiver. #### Throws SwiftProtobufError if decoding fails. > **Info:** > > **Notice** > > Note: If this method throws an error, the message may still have been ### Parameters | Name | Type | Summary | | --- | --- | --- | | bytes | Bytes | - | | extensions | (any ExtensionMap)? | An `ExtensionMap` used to look up and decode any extensions in this message or messages nested within this message's fields. | | partial | Bool | If `false` (the default), this method will check `Message/isInitialized-6abgi` after decoding to verify that all required fields are present. If any are missing, this method throws `BinaryDecodingError/missingRequiredFields`. | | options | BinaryDecodingOptions | The `BinaryDecodingOptions` to use. | --- ## Overload 5 mutating func merge(serializedData data: Data, extensions: (any ExtensionMap)? = nil, partial: Bool = false, options: BinaryDecodingOptions = BinaryDecodingOptions()) throws #### Summary Updates the message by decoding the given Data value containing a serialized message in Protocol Buffer binary format into the receiver. #### Throws BinaryDecodingError if decoding fails. > **Info:** > > **Notice** > > Note: If this method throws an error, the message may still have been ### Parameters | Name | Type | Summary | | --- | --- | --- | | bytes | Bytes | - | | extensions | (any ExtensionMap)? | An `ExtensionMap` used to look up and decode any extensions in this message or messages nested within this message's fields. | | partial | Bool | If `false` (the default), this method will check `Message/isInitialized-6abgi` after decoding to verify that all required fields are present. If any are missing, this method throws `BinaryDecodingError/missingRequiredFields`. | | options | BinaryDecodingOptions | The `BinaryDecodingOptions` to use. | ---