settings_common/utils.rs
1// Copyright 2025 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5/// The `Merge` trait allows merging two structs.
6pub trait Merge<Other = Self> {
7 /// Returns a copy of the original struct where the values of all fields set in `other`
8 /// replace the matching fields in the copy of `self`.
9 fn merge(&self, other: Other) -> Self;
10}