aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/derive_common.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-netdoc: constructor derive: allow setting deprecated fieldsIan Jackson2026-06-161-0/+1
| | | | We must generally set such a field to the default.
* tor-netdoc: Add some TODOsIan Jackson2026-05-271-0/+2
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3985#note_3413183
* tor-netdoc: Rename FixedString to ConstantStringIan Jackson2026-05-271-26/+26
| | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3985#note_3413182 I left the word "fixed" in some of the docs and error messages, where it seemed to make sense.
* tor-netdoc: Provide FixedString and defined_fixed_stringIan Jackson2026-05-271-0/+131
| | | | We're going to want quite a lot of this for eg network-status-version.
* tor-netdoc: Constructor: insist on proper Constructor non-exhaustive patternIan Jackson2026-05-131-1/+9
|
* Merge branch 'parse2-more-debug' into 'main'Clara Engler2026-04-211-0/+2
|\ | | | | | | | | Add debugging support to ItemValueParseable derive See merge request tpo/core/arti!3881
| * tor-netdoc: derives debug: Add a missing trait importIan Jackson2026-04-131-0/+2
| | | | | | | | | | | | Without this adding `#[deftly(netdoc(debug))]` can fail to build, because the encoding module doesn't have `io::Write` in its `pub use`. (Unlike parse2, it doesn't have a separate macro prelude.)
* | tor-netdoc: Support `#[deftly(netdoc(skip))]` in itemsIan Jackson2026-04-201-1/+2
| | | | | | | | Ie for "arguments" that don't actually appear.
* | tor-netdoc: derives: Remove an otiose testIan Jackson2026-04-141-1/+1
|/ | | | T_SIGNATURES is false, just above.
* Merge branch 'netdoc-fixes' into 'main'Clara Engler2026-04-081-1/+1
|\ | | | | | | | | tor-netdoc: Three fixes to parsing and encoding See merge request tpo/core/arti!3862
| * tor-netdoc: Constructor: Produce better error when field isn't DefaultIan Jackson2026-04-071-1/+1
| | | | | | | | | | The type error's span now points at the field type, rather than into the macro.
* | tor-netdoc: parse2/encode derive: Use unquoted attributes at call sitesIan Jackson2026-04-071-1/+1
| |
* | tor-netdoc: Constructor derive: Use meta_quoted rigorousIan Jackson2026-04-071-3/+3
|/
* tor-netdoc: Constructor: Fixes to generated docsIan Jackson2026-04-011-8/+8
| | | | | | | | | | Now some bugs have become visible. * Properly ``-quote the name in the heading. * Add a missing space before `{` * Adjust the fields to level-4 indent. * In `construct()`, ``-quote the name, and xref it in the body, not the title (which rustdoc makes a link to the fn itself)
* tor-netdoc: Constructor: Reformat $/// doc sectionIan Jackson2026-04-011-10/+6
| | | | | | This lines all the docs lines up, so we can see our indentation. No change to the generated docs.
* tor-netdoc: Constructor: Use $/// deftly featureIan Jackson2026-04-011-30/+27
| | | | No change to the generated docs.
* tor-netdoc: Constructor: Fix it so it actually worksIan Jackson2026-04-011-3/+3
| | | | | | The hidden __non_exhaustive field has to be pub. And, fix the use site, currently AuthCert.
* Fix typosTobias Stoeckmann2026-03-241-1/+1
| | | | Typos found with codespell
* tor-netdoc: parse2: Move hash out of signature itemsIan Jackson2026-03-191-3/+2
| | | | | | | | | | During encoding, including these hashes in the signature items makes no sense. The hashes are an *input* to the signature items, but not part of them. Move the hashes out of the items. Instead, provide each signatures section type with a hash accumulator type, in which the hash(es) are stored.
* tor-netdoc: NetdocParseableSignatures: Make into its own macroIan Jackson2026-03-191-1/+1
| | | | | | This is going to be its own trait and it is usually best if macros are named after traits, rather than having the macro derive a different trait depending on meta attributes.
* tor-netdoc: constructors: Use manual non exhaustiveIan Jackson2026-01-141-1/+5
| | | | With `#[non_exhaustive]`, you're not allowed to write even `Thing { ..base }`.
* tor-netdoc: derives: New `skip` document field optionIan Jackson2026-01-141-6/+11
| | | | | This lets us having document items that are "manually non exhaustive" which is necessary for struct literal constructors.
* tor-netdoc: Improve docs for derived constructorsClara Engler2026-01-131-2/+12
|
* tor-netdoc: improve derived Constructor docs with a kind-of exampleIan Jackson2026-01-131-0/+11
| | | | Let's not ask users to refer to the Constructor derive macro docs.
* tor-netdoc: implement Constructor deriveIan Jackson2026-01-131-3/+54
|
* tor-netdoc: constructor derive: APIIan Jackson2026-01-131-1/+93
| | | | This doesn't actually work of course.
* tor-netdoc: debug: Add a placeholder debug print to all the other derivesIan Jackson2025-12-101-0/+21
| | | | | | | | We want to recognise `#[deftly(netdoc(debug))]` because otherwise we have to make lots of these attributes conditional. So, implement it for *all* the derives, providing a nugatory debug statement.
* tor-netdoc: derive: F_KEYWORD_REPORT: put concat on the outsideIan Jackson2025-12-101-2/+2
| | | | This makes it possible to use $F_KEYWORD_REPORT within another concat.
* tor-netdoc: derive_common: Break out docs for attrs in flattenIan Jackson2025-12-101-0/+11
| | | | | | Code motion fromk NetdocParseableFields to NetdocFieldsDeriveCommon. This uses the derive-deftly imported doc comment feature.
* tor-netdoc: derive_common: Break out field ordering checkIan Jackson2025-12-101-0/+17
| | | | Code motion from NetdocParseable to NetdocEntireDeriveCommon.
* tor-netdoc: derive_common: Break out item field type definitionsIan Jackson2025-12-101-0/+6
| | | | Code motion from ItemValueParseable to NetdocItemDeriveCommon.
* tor-netdoc: derive_common: Break out main field type definitionsIan Jackson2025-12-101-0/+11
| | | | | | | | Code motion from NetdocParseable to NetdocEntireDeriveCommon. Code motion from NetdocParseableFields to NetdocFieldsDeriveCommon. Again, the encoder wants exactly this logic.
* tor-netdoc: derive_common: Break out F_KEYWORD_*, F_FLATTEN, F_NORMALIan Jackson2025-12-101-0/+33
| | | | | | | Code motion from NetdocSomeItemsParseableCommon to NetdocSomeItemsDeriveCommon. Encoding wants exactly the same logic.
* tor-netdoc: Introduce new derive_common Rust module with d-d modulesIan Jackson2025-12-101-0/+55
| | | | | | | There is nothing actually in any of these yet. But it is most convenient to lay out the structure now. We'll move code into these modules in forthcoming commits.
* tor-netdoc: Break out netdoc_ordering_check into new derive_common.rsIan Jackson2025-12-101-0/+35