# merge Source: https://www.nianticspatial.com/docs/api/swift/NSDK.Nsdk_Vps_FusionHypothesis.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 | | --- | --- | --- | | source | Self | Message that should be merged to the original one. | | fieldMask | Google_Protobuf_FieldMask | FieldMask specifies which fields should be merged. | | mergeOption | Google_Protobuf_FieldMask.MergeOptions | Options that customize how the fields are merged. | --- ## 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 partially mutated by the binary data that was decoded before the error occurred. ### Parameters | Name | Type | Summary | | --- | --- | --- | | bytes | Bytes | The binary-encoded message data to decode. | | 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 partially mutated by the binary data that was decoded before the error occurred. ### Parameters | Name | Type | Summary | | --- | --- | --- | | bytes | RawSpan | The `RawSpan` of binary-encoded message data to decode. | | 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 partially mutated by the binary data that was decoded before the error occurred. ### Parameters | Name | Type | Summary | | --- | --- | --- | | bytes | Bytes | The binary-encoded message data to decode. | | 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 partially mutated by the binary data that was decoded before the error occurred. ### Parameters | Name | Type | Summary | | --- | --- | --- | | bytes | Bytes | The binary-encoded message data to decode. | | 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 partially mutated by the binary data that was decoded before the error occurred. ### Parameters | Name | Type | Summary | | --- | --- | --- | | data | Data | The binary-encoded message data to decode. | | 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. | ---