summaryrefslogtreecommitdiff
path: root/crates/tor-netdoc
Commit message (Collapse)AuthorAgeFilesLines
...
* | | tor-netdoc: Throw rather than squirreling error from NormalItemArgumentIan Jackson2025-12-041-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | NormalItemArgument is for types where we use the Display as the netdoc argument formatter. But what if gives the empty string? Previously we would allow `add_arg` to handle the error. That would record it in the NetdocEncoder. That's kind of OK, but it will prevent the caller from aborting early (and from elaborating the error).
* | | tor-netdoc: Explain some downsides to use of ItemEncoder::argIan Jackson2025-12-041-0/+3
| | |
* | | tor-netdoc: Suppress a clippy warning more thoroughlyIan Jackson2025-12-041-1/+2
| | |
* | | tor-netdoc: Suppress a clippy warningIan Jackson2025-12-031-0/+1
| | | | | | | | | | | | | | | | | | | | | This code sometimes expands to `let item = item;`. That's OK. In derive-deftly 1.5.x the two `item` wrongly had different hygiene span so the warning didn't trigger.
* | | Update to derive-deftly 1.6.0Ian Jackson2025-12-031-1/+1
| |/ |/| | | | | | | | | | | | | | | This has: * Fixes to hygiene spans from the new modules feature, needed for my WIP netdoc encoder derive. * A substantially richer `${error }` construct.
* | parse2: ItemValueParseable, netdoc(object, rest): docs: state signatureIan Jackson2025-12-021-1/+3
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3502/diffs?commit_id=f9a6d90ec6d5abf2958534d2c100c84f325e3634#2525aaf11b44162850101813478c4734160e11fa_920_919
* | parse2: ItemValueParseable, netdoc(object, rest): docs: clarify errorsIan Jackson2025-12-021-1/+1
| | | | | | | | | | | | The error is not really discarded (which would seem to mean ignoring it). The erorr *value* is discarded and is replaced with a less informative error value.
* | parse2: ItemValueParseable, netdoc(object, rest): docs: fix typoIan Jackson2025-12-021-1/+1
| |
* | parse2: ItemValueParseable, netdoc(rest, with): reworkIan Jackson2025-12-023-7/+11
| | | | | | | | | | | | | | | | | | | | The path in `with` must always be a module, not a function, because we need to use it for encoding too. In the case of `rest`, it's probably sensible to require a different function name, given that the semantics are subtly different to those of `rest` without `with`, since the latter can only get a single word but with `rest` you get the whole line.
* | parse2: ItemValueParseable, netdoc(rest): docs: clarify behaviourIan Jackson2025-12-021-1/+1
| |
* | Remove semver.md files post-releaseGabriela Moldovan2025-12-021-9/+0
|/
* Bump all the unstable tor- and arti- crates to 0.37.0.Gabriela Moldovan2025-12-021-13/+13
| | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.37.0 done
* netdoc: Add missing docs for encode_pow_params()Gabriela Moldovan2025-12-011-0/+1
|
* netdoc: allow unstable_name_collisions lint for exactly_one()Gabriela Moldovan2025-12-011-0/+5
| | | | This silences a new warning on nightly.
* parse2: Move naming convention to pocClara Engler2025-11-272-15/+15
| | | | | | | | | | | This commit moves the "Naming Convention" of the parse2::poc module into the respective module, as it does not apply to parse2 itself, as outlined in arti!3462. With this commit, there remains `NdaSystemTimeDeprecatedSyntax` as the only type outside poc following this naming schema. However, because it is more or less already deprecated anyways, there is no real need to bother with it any further.
* tor-netdoc: Rename ItemArgument method to write_arg_ontoIan Jackson2025-11-262-12/+12
| | | | | | | tor_bytes also has a write_onto method. And types (especially utility types like `Ignored`) might conceivably implement both! No need for semver update since this was pub(crate) in the previous release.
* tor-netdoc: Minor wording fix in a docIan Jackson2025-11-261-1/+1
| | | | | This is in the ItemValueParseable derive, so the individual fields are Arguments, not Items.
* tor-netdoc: Minor grammar fix in a docIan Jackson2025-11-261-1/+1
|
* Merge branch 'relay-flags-options-trait' into 'main'Ian Jackson2025-11-254-56/+56
|\ | | | | | | | | tor-netdoc: Parameterise RelayFlagsParser by an options trait instead See merge request tpo/core/arti!3489
| * tor-netdoc: relay_flags: Tidy up the formatting (rustfmt)Ian Jackson2025-11-241-9/+3
| |
| * tor-netdoc: Rename RelayFlagsParser to relay_flags::ParserIan Jackson2025-11-244-10/+10
| | | | | | | | | | | | | | Since we expose the relay_flags module, it makes sense to give this a shorter name. (It had a longer name when it was part of the netstatus module.)
| * tor-netdoc: relay_flags: Remove two now-not-needed type aliasesIan Jackson2025-11-243-13/+5
| | | | | | | | The generic parser type is easy enough to name now.
| * tor-netdoc: Parameterise RelayFlagsParser by an options trait insteadIan Jackson2025-11-241-41/+55
| | | | | | | | | | | | | | This avoids a lot of messing about with const generics. Suggested by the author of enumset: https://github.com/Lymia/enumset/issues/74#issuecomment-3561337369
* | Merge branch 'nd-test' into 'main'Ian Jackson2025-11-253-17/+23
|\ \ | | | | | | | | | | | | tor-netdoc: Move parse2/test.rs to test2.rs See merge request tpo/core/arti!3486
| * | tor-netdoc: test2: Run rustfmtIan Jackson2025-11-241-10/+2
| | | | | | | | | | | | Tidy up the imports.
| * | tor-netdoc: test2: Adjust type aliasesIan Jackson2025-11-241-14/+12
| | | | | | | | | | | | | | | | | | Now that this module is not inside parse2 its identifier namespace oughtn't to be parse-specific. Rename things so that every imports/aliases related to parsing implies parsing in its name.
| * | tor-netdoc: Move parse2/test.rs to test2.rsIan Jackson2025-11-243-7/+23
| | | | | | | | | | | | | | | | | | | | | We're going to use this for the encoder testing too, so it needs to be not buried inside parse2. This commit is the file rename plus minimal changes to make it compile.
* | | Merge branch 'p2-mult' into 'main'Ian Jackson2025-11-255-70/+56
|\ \ \ | |_|/ |/| | | | | | | | tor-netdoc: parse2: Combine MultiplicitySelector See merge request tpo/core/arti!3478
| * | tor-netdoc: Add a comment explaining why P2MultiplicitySelectorIan Jackson2025-11-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | as per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3478#note_3291482 encode::MultiplicitySelector doesn't actually exist yet in this branch, but it will do. Don't mention that fact as we'll probably just forget to update this comment...
| * | semver.md: Document change to parse2::MultiplicitySelectorIan Jackson2025-11-241-0/+1
| | |
| * | tor-netdoc: rustfmt to tidy up importsIan Jackson2025-11-192-5/+2
| | |
| * | tor-netdoc: avoid importing MultiplicitySelector outside parse2Ian Jackson2025-11-191-4/+4
| | | | | | | | | | | | | | | | | | The encoder is going to need to have a different MultiplicitySelector (just because of different variance, really) so we mustn't import it under this name.
| * | tor-netdoc: parse2: Combine all the multiplicity SelectorsIan Jackson2025-11-194-53/+38
| | | | | | | | | | | | | | | There is no conflict between the different uses. Having just one type makes things simpler.
| * | tor-netdoc: parse2: Move multiplicity docs examples into Methods traitsIan Jackson2025-11-191-32/+32
| | | | | | | | | | | | | | | | | | | | | We're going to combine all the Selector types, so it won't be able to have these. The diff is misleading: it's docs for the Selectors that's moving.
* | | Merge branch 'bug2172' into 'main'Nick Mathewson2025-11-241-1/+1
|\ \ \ | |_|/ |/| | | | | | | | | | | | | | tor-llcrypto: Stop deriving Deref in CtByteArray Closes #2172 See merge request tpo/core/arti!3432
| * | tor-llcrypto: Stop deriving Deref in CtByteArrayNeel Chauhan2025-11-241-1/+1
| | |
* | | tor-netdoc: encode: Explain why NetdocEncoder contains a ResultIan Jackson2025-11-191-1/+2
| | |
* | | tor-netdoc: parse2 docs: Clarify that these are for parsingIan Jackson2025-11-191-3/+3
| | | | | | | | | | | | We're going to have separate traits for encoding.
* | | tor-netdoc: parse2 docs: Fix ItemObjectParseableIan Jackson2025-11-191-4/+1
| | | | | | | | | | | | Once upon a time this trait handled multiplicity. But it doesn't any more.
* | | tor-netdoc: parse2 docs: Improve `#[deftly(netdoc(rest))]` docsIan Jackson2025-11-191-0/+2
| | |
* | | tor-netdoc: parse2 docs: Fix docs for ItemArgumentParseableIan Jackson2025-11-191-3/+2
| | | | | | | | | | | | This is not impl for all FromStr. We have NormalItemArgument now.
* | | tor-netdoc: parse2 docs: Document BTreeSet in multiplicityIan Jackson2025-11-191-2/+3
| |/ |/| | | | | This was added at some point, but not documented.
* | Merge branch 'pub-encode' into 'main'Ian Jackson2025-11-198-32/+68
|\ \ | | | | | | | | | | | | tor-netdoc: Make much more of encode module public See merge request tpo/core/arti!3471
| * | tor-netdoc: Add a blank line for reading clarityIan Jackson2025-11-181-0/+1
| | | | | | | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3471#note_3288716
| * | tor-netdoc: impl Default for NetdocEncoderIan Jackson2025-11-181-0/+7
| | | | | | | | | | | | | | | clippy points out that if argument-less `new` can exist, so should Default.
| * | tor-netdoc: Make much more of the encode module contents publicIan Jackson2025-11-183-14/+14
| | | | | | | | | | | | | | | My planned new derive for encoding will be pub, but cfg gated, like parse2 is.
| * | tor-netdoc: Add a note about the nature of NetdocBuilderIan Jackson2025-11-181-1/+13
| | |
| * | tor-netdoc: Implement KeywordEncodable for &'static strIan Jackson2025-11-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | My planned encoding derive macro is going to provide keywords as literal strings. (The purpose of this trait is to allow the old parser to be generic over its keyword constants, not to provide type-safety against passing non-keyword strings to document encoders. Such bugs aren't very likely and will be especially unlikely when we're deriving encoders.)
| * | tor-netdoc: Split off Keyword::to_str into its own trait (fmt)Ian Jackson2025-11-181-1/+3
| | |
| * | tor-netdoc: Split off Keyword::to_str into its own traitIan Jackson2025-11-187-12/+19
| | | | | | | | | | | | | | | My planned encoding derive macro is not going to use `decl_keyword!` but will need to call `NetdocEncoder::item`.