• Home
  • Raw
  • Download

Lines Matching +full:merge +full:- +full:multiple

1 <!---
3 SPDX-License-Identifier: CC0-1.0
4 -->
6 # merge-rs
8 The `merge` crate provides the `Merge` trait that can be used to merge multiple
12 trait Merge {
13 fn merge(&mut self, other: Self);
17 `Merge` is implemented for `Option` and can be derived for structs:
19 <!-- should be kept in sync with examples/user.rs -->
21 use merge::Merge;
23 #[derive(Merge)]
25 // Fields with the skip attribute are skipped by Merge
26 #[merge(skip)]
29 // The Merge implementation for Option replaces its value if it is None
32 // The strategy attribute is used to customize the merge behavior
33 #[merge(strategy = merge::vec::append)]
47 ferris.merge(defaults);
54 A merge strategy is a function with the signature `fn merge<T>(left: &mut T,
55 right: T)` that merges `right` into `left`. The `merge` crate provides
59 The trait can be used to merge configuration from different sources, for
60 example environment variables, multiple configuration files and command-line
67 - `derive` (default): Enables the derive macro for the `Merge` trait using the
69 - `num` (default): Enables the merge strategies in the `num` module that
71 - `std` (default): Enables the merge strategies in the `vec` module that
72 require the standard library. If this feature is not set, `merge` is a
82 mail to [~ireas/public-inbox@lists.sr.ht][] using the `[merge-rs]` prefix in
87 This project is dual-licensed under the [Apache-2.0][] and [MIT][] licenses.
92 `merge-rs` complies with [version 3.0 of the REUSE specification][reuse].
94 [~ireas/public-inbox@lists.sr.ht]: mailto:~ireas/public-inbox@lists.sr.ht
95 [Apache-2.0]: https://opensource.org/licenses/Apache-2.0