├── .github ├── latest.txt └── workflows │ ├── master.yml │ └── rust_version.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── RELEASES.md ├── notes.md ├── src ├── args.rs ├── lib.rs ├── lib_macros.rs ├── subst.rs ├── tests.rs └── utils.rs └── tests ├── integration.rs ├── test_ui.rs └── ui ├── trait_gen.rs ├── trait_gen.stderr ├── trait_gen_if.rs └── trait_gen_if.stderr /.github/latest.txt: -------------------------------------------------------------------------------- 1 | rustc 1.87.0 (17067e9ac 2025-05-09) 2 | -------------------------------------------------------------------------------- /.github/workflows/master.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: 4 | push: 5 | branches: [ "master" ] 6 | paths-ignore: 7 | - .github/workflows/** 8 | pull_request: 9 | branches: [ "master" ] 10 | 11 | env: 12 | CARGO_TERM_COLOR: always 13 | 14 | jobs: 15 | build: 16 | runs-on: ubuntu-latest 17 | steps: 18 | - uses: actions/checkout@v3 19 | - name: Build 20 | run: cargo build --verbose 21 | - name: Run tests 22 | run: | 23 | rustc -V 24 | cargo test --verbose 25 | cargo test --verbose --all-features 26 | cargo test -r --verbose 27 | -------------------------------------------------------------------------------- /.github/workflows/rust_version.yml: -------------------------------------------------------------------------------- 1 | name: Rust-version 2 | 3 | on: 4 | workflow_dispatch: 5 | schedule: 6 | - cron: '0 16 * * 6' 7 | 8 | env: 9 | CARGO_TERM_COLOR: always 10 | 11 | jobs: 12 | get-version: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v3 16 | with: 17 | token: ${{ secrets.TOKEN_VERSION }} 18 | - name: Fetch Rust version 19 | run: | 20 | rustc -V 21 | rustc -V > .github/latest.txt 22 | - name: Check for modified files 23 | id: git-check 24 | run: echo modified=$([ -z "`git status --porcelain`" ] && echo "false" || echo "true") >> $GITHUB_OUTPUT 25 | - name: Commit latest release version 26 | if: steps.git-check.outputs.modified == 'true' 27 | run: | 28 | git config --global user.name 'Redglyph' 29 | git config --global user.email 'redglyph@gmail.com' 30 | git commit -am "New Rust version" 31 | git push 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.idea 2 | /target 3 | **/*.rs.bk 4 | *.iml 5 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "equivalent" 7 | version = "1.0.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" 10 | 11 | [[package]] 12 | name = "glob" 13 | version = "0.3.2" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" 16 | 17 | [[package]] 18 | name = "hashbrown" 19 | version = "0.15.3" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" 22 | 23 | [[package]] 24 | name = "indexmap" 25 | version = "2.9.0" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" 28 | dependencies = [ 29 | "equivalent", 30 | "hashbrown", 31 | ] 32 | 33 | [[package]] 34 | name = "itoa" 35 | version = "1.0.15" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" 38 | 39 | [[package]] 40 | name = "memchr" 41 | version = "2.7.4" 42 | source = "registry+https://github.com/rust-lang/crates.io-index" 43 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 44 | 45 | [[package]] 46 | name = "proc-macro-error-attr2" 47 | version = "2.0.0" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" 50 | dependencies = [ 51 | "proc-macro2", 52 | "quote", 53 | ] 54 | 55 | [[package]] 56 | name = "proc-macro-error2" 57 | version = "2.0.1" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" 60 | dependencies = [ 61 | "proc-macro-error-attr2", 62 | "proc-macro2", 63 | "quote", 64 | "syn", 65 | ] 66 | 67 | [[package]] 68 | name = "proc-macro2" 69 | version = "1.0.95" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" 72 | dependencies = [ 73 | "unicode-ident", 74 | ] 75 | 76 | [[package]] 77 | name = "quote" 78 | version = "1.0.40" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" 81 | dependencies = [ 82 | "proc-macro2", 83 | ] 84 | 85 | [[package]] 86 | name = "ryu" 87 | version = "1.0.20" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" 90 | 91 | [[package]] 92 | name = "serde" 93 | version = "1.0.219" 94 | source = "registry+https://github.com/rust-lang/crates.io-index" 95 | checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" 96 | dependencies = [ 97 | "serde_derive", 98 | ] 99 | 100 | [[package]] 101 | name = "serde_derive" 102 | version = "1.0.219" 103 | source = "registry+https://github.com/rust-lang/crates.io-index" 104 | checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" 105 | dependencies = [ 106 | "proc-macro2", 107 | "quote", 108 | "syn", 109 | ] 110 | 111 | [[package]] 112 | name = "serde_json" 113 | version = "1.0.140" 114 | source = "registry+https://github.com/rust-lang/crates.io-index" 115 | checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" 116 | dependencies = [ 117 | "itoa", 118 | "memchr", 119 | "ryu", 120 | "serde", 121 | ] 122 | 123 | [[package]] 124 | name = "serde_spanned" 125 | version = "0.6.8" 126 | source = "registry+https://github.com/rust-lang/crates.io-index" 127 | checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" 128 | dependencies = [ 129 | "serde", 130 | ] 131 | 132 | [[package]] 133 | name = "syn" 134 | version = "2.0.101" 135 | source = "registry+https://github.com/rust-lang/crates.io-index" 136 | checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" 137 | dependencies = [ 138 | "proc-macro2", 139 | "quote", 140 | "unicode-ident", 141 | ] 142 | 143 | [[package]] 144 | name = "target-triple" 145 | version = "0.1.4" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "1ac9aa371f599d22256307c24a9d748c041e548cbf599f35d890f9d365361790" 148 | 149 | [[package]] 150 | name = "termcolor" 151 | version = "1.4.1" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" 154 | dependencies = [ 155 | "winapi-util", 156 | ] 157 | 158 | [[package]] 159 | name = "toml" 160 | version = "0.8.22" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | checksum = "05ae329d1f08c4d17a59bed7ff5b5a769d062e64a62d34a3261b219e62cd5aae" 163 | dependencies = [ 164 | "serde", 165 | "serde_spanned", 166 | "toml_datetime", 167 | "toml_edit", 168 | ] 169 | 170 | [[package]] 171 | name = "toml_datetime" 172 | version = "0.6.9" 173 | source = "registry+https://github.com/rust-lang/crates.io-index" 174 | checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" 175 | dependencies = [ 176 | "serde", 177 | ] 178 | 179 | [[package]] 180 | name = "toml_edit" 181 | version = "0.22.26" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" 184 | dependencies = [ 185 | "indexmap", 186 | "serde", 187 | "serde_spanned", 188 | "toml_datetime", 189 | "toml_write", 190 | "winnow", 191 | ] 192 | 193 | [[package]] 194 | name = "toml_write" 195 | version = "0.1.1" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076" 198 | 199 | [[package]] 200 | name = "trait-gen" 201 | version = "2.0.4" 202 | dependencies = [ 203 | "proc-macro-error2", 204 | "proc-macro2", 205 | "quote", 206 | "syn", 207 | "trybuild", 208 | ] 209 | 210 | [[package]] 211 | name = "trybuild" 212 | version = "1.0.104" 213 | source = "registry+https://github.com/rust-lang/crates.io-index" 214 | checksum = "6ae08be68c056db96f0e6c6dd820727cca756ced9e1f4cc7fdd20e2a55e23898" 215 | dependencies = [ 216 | "glob", 217 | "serde", 218 | "serde_derive", 219 | "serde_json", 220 | "target-triple", 221 | "termcolor", 222 | "toml", 223 | ] 224 | 225 | [[package]] 226 | name = "unicode-ident" 227 | version = "1.0.18" 228 | source = "registry+https://github.com/rust-lang/crates.io-index" 229 | checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" 230 | 231 | [[package]] 232 | name = "winapi-util" 233 | version = "0.1.9" 234 | source = "registry+https://github.com/rust-lang/crates.io-index" 235 | checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" 236 | dependencies = [ 237 | "windows-sys", 238 | ] 239 | 240 | [[package]] 241 | name = "windows-sys" 242 | version = "0.59.0" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 245 | dependencies = [ 246 | "windows-targets", 247 | ] 248 | 249 | [[package]] 250 | name = "windows-targets" 251 | version = "0.52.6" 252 | source = "registry+https://github.com/rust-lang/crates.io-index" 253 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 254 | dependencies = [ 255 | "windows_aarch64_gnullvm", 256 | "windows_aarch64_msvc", 257 | "windows_i686_gnu", 258 | "windows_i686_gnullvm", 259 | "windows_i686_msvc", 260 | "windows_x86_64_gnu", 261 | "windows_x86_64_gnullvm", 262 | "windows_x86_64_msvc", 263 | ] 264 | 265 | [[package]] 266 | name = "windows_aarch64_gnullvm" 267 | version = "0.52.6" 268 | source = "registry+https://github.com/rust-lang/crates.io-index" 269 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 270 | 271 | [[package]] 272 | name = "windows_aarch64_msvc" 273 | version = "0.52.6" 274 | source = "registry+https://github.com/rust-lang/crates.io-index" 275 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 276 | 277 | [[package]] 278 | name = "windows_i686_gnu" 279 | version = "0.52.6" 280 | source = "registry+https://github.com/rust-lang/crates.io-index" 281 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 282 | 283 | [[package]] 284 | name = "windows_i686_gnullvm" 285 | version = "0.52.6" 286 | source = "registry+https://github.com/rust-lang/crates.io-index" 287 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 288 | 289 | [[package]] 290 | name = "windows_i686_msvc" 291 | version = "0.52.6" 292 | source = "registry+https://github.com/rust-lang/crates.io-index" 293 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 294 | 295 | [[package]] 296 | name = "windows_x86_64_gnu" 297 | version = "0.52.6" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 300 | 301 | [[package]] 302 | name = "windows_x86_64_gnullvm" 303 | version = "0.52.6" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 306 | 307 | [[package]] 308 | name = "windows_x86_64_msvc" 309 | version = "0.52.6" 310 | source = "registry+https://github.com/rust-lang/crates.io-index" 311 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 312 | 313 | [[package]] 314 | name = "winnow" 315 | version = "0.7.10" 316 | source = "registry+https://github.com/rust-lang/crates.io-index" 317 | checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" 318 | dependencies = [ 319 | "memchr", 320 | ] 321 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "trait-gen" 3 | description = "Trait implementation generator macro" 4 | version = "2.0.4" 5 | edition = "2021" 6 | rust-version = "1.61.0" 7 | authors = ["Redglyph"] 8 | categories = ["rust-patterns"] 9 | keywords = ["proc-macro", "macro", "trait", "generator"] 10 | documentation = "https://docs.rs/trait-gen" 11 | homepage = "https://github.com/blueglyph/trait_gen" 12 | license = "MIT OR Apache-2.0" 13 | repository = "https://github.com/blueglyph/trait_gen" 14 | readme = "README.md" 15 | 16 | [lib] 17 | proc-macro = true 18 | 19 | [features] 20 | default = [] 21 | no_type_gen = [] 22 | 23 | [dependencies] 24 | quote = "1.0.40" 25 | proc-macro2 = { version = "1.0.95", features = ["span-locations"] } 26 | syn = { version = "2.0.101", features = ["full", "visit-mut", "extra-traits"] } 27 | proc-macro-error2 = "2.0.1" 28 | 29 | [dev-dependencies] 30 | trybuild = "1.0.104" 31 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright 2023 Redglyph 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to 5 | deal in the Software without restriction, including without limitation the 6 | rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7 | sell copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [](https://crates.io/crates/trait-gen) 2 | [](https://docs.rs/trait-gen) 3 | [](https://github.com/blueglyph/trait_gen/actions) 4 | [](https://github.com/blueglyph/trait_gen/blob/master/LICENSE-MIT) 5 | 6 |