summaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/parse2
Commit message (Collapse)AuthorAgeFilesLines
* tor-netdoc: Add unit tests for NotPresent and Ignored objectsIan Jackson2025-10-231-1/+32
|
* tor-netdoc: Add unit tests for NotPresent itemsIan Jackson2025-10-231-0/+4
|
* tor-netcoc: Introduce NotPresent, for absent multiplicityIan Jackson2025-10-231-0/+11
| | | | | | | | | Currently this is mishandled: the current use sites (in rs/each_variety.rs) use Option<Ignored>, which would reject repeated items with that keyword, which is technically wrong. And encoing will become a problem. Vec<Ignored> would be wrong too. Instead, broaden NotPresent and give it multiplicity impls.
* tor-netdoc: Move parse2 impls on Ignored to types/misc.rsIan Jackson2025-10-231-22/+0
| | | | | | This seems to be where we're putting most of the parse2 impls on these types, now. That makes more sense as parse2 becomes more of a proper thing.
* tor-netdoc: NetdocParseableFields derive: support flatten (test)Ian Jackson2025-10-221-0/+11
|
* tor-netdoc: NetdocParseableFields derive: support flattenIan Jackson2025-10-221-2/+26
| | | | | | | | | This allows a NetdocParseableFields inside a NetdocParseableFields. The code is rather duplicative with the NetdocParseable implementation. This is due to limitations in derive-deftly; see https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/merge_requests/525 where I'm trying to start to address them.
* tor-netdoc: NetdocParseableFields derive: break out kw variableIan Jackson2025-10-221-1/+3
| | | | We're going to reuse this.
* Merge branch 'p2-misc-fixes' into 'main'opara2025-10-211-1/+5
|\ | | | | | | | | tor-netdoc: parse2: Minor fixes See merge request tpo/core/arti!3376
| * tor-netdoc: NetdocParseable derive: use more explicit syntaxIan Jackson2025-10-211-1/+1
| | | | | | | | In principle some other trait might be in scope.
| * tor-netdoc: parse2: Don't declare internal error on subdoc intro itemsIan Jackson2025-10-211-0/+4
| | | | | | | | | | subdoc intro items aren't inherently incoherent, but implementing them is nontrivial. Let's reject them with a bespoke error instead.
* | Merge branch 'p2-blanket-arc' into 'main'David Goulet2025-10-212-7/+30
|\ \ | | | | | | | | | | | | tor-netdoc: blanket impl parse2 traits for Arc See merge request tpo/core/arti!3381
| * | tor-netdoc: blanket impl parse2 traits for ArcIan Jackson2025-10-212-7/+30
| |/ | | | | | | This replaces one ad-hoc impl and will avoid having to have any more.
* / tor-netdoc: parse2: Provide documentation for derived Accumulator typesIan Jackson2025-10-211-0/+3
|/
* tor-netdoc: tests: Move vote parsing test to netstatus.rsIan Jackson2025-10-151-12/+0
| | | | | This is a test of real document structs now, albeit that it still uses one of the types from `poc`.
* tor-netdoc: tests: Use real `RouterStatus` in `parse2::poc`Ian Jackson2025-10-151-9/+7
| | | | This now exercises all the new parsing code.
* tor-netdoc: impl parse2 multiplicity for BTreeSetIan Jackson2025-10-152-1/+34
|
* tor-netdoc: impl parse2 traits for protoversIan Jackson2025-10-152-0/+24
|
* tor-netdoc: Provide convenience method for handling invalid argumentsIan Jackson2025-10-151-0/+14
|
* tor-netdoc: Replace NdaSystemTimeDeprecatedSyntax with Ios8601TimeSpIan Jackson2025-10-091-4/+5
| | | | | Previously we needed this separate type because Ios8601TimeSp is FromStr which prevented a correct ItemArgumentParseable impl.
* tor-netdoc: parse2: Fix some slips in doc commentsIan Jackson2025-10-091-3/+3
|
* tor-netdoc: parse2: Work around MSRV unhelpful lifetimeIan Jackson2025-10-091-2/+6
| | | | | | | | | | 1.85.1 rejects this, because it doesn't extend the lifetime of the `format_args!`. 1.90 is fine with it. I want to keep `format!` not `String::new()` so that it's easy to change back. That means a clippy allow. Getting that to apply to the code inside the derive is tricky, so I've enabled it for the whole module. (IMO this clippy lint is pretty annoying anyway.)
* tor-netdoc: parse2 tests: Test ParseError Display and Error implIan Jackson2025-10-091-6/+29
|
* tor-netdoc: parse2 tests: Have t_err_* return the errorIan Jackson2025-10-091-5/+4
|
* tor-netdoc: parse2 tests: Have t_err_* return the error (pre-fmt)Ian Jackson2025-10-091-1/+6
|
* tor-netdoc: parse2 tests: Check columnsIan Jackson2025-10-091-7/+15
|
* tor-netdoc: parse2 tests: Check columns (pre-fmt)Ian Jackson2025-10-091-1/+2
|
* tor-netdoc: parse2: Add column field to PaarsError and print itIan Jackson2025-10-091-2/+12
|
* tor-netdoc: parse2: Add .column() accessor to ErrorProblemIan Jackson2025-10-091-1/+28
| | | | We'll want to general way to find the error problem column.
* tor-netdoc: parse2: Add column field as far as ErrorProblemIan Jackson2025-10-092-7/+47
| | | | | | | Provide facilities in ArgumnetStream for determining the column, and add the field to all the error types up to and including ErrorProblem. The value still needs to be propagated to ParseError, and printed there.
* tor-netdoc: parse2: Replace EP with AE in derive fields rest pathIan Jackson2025-10-091-1/+2
|
* tor-netdoc: parse2: Replace EP with AE in NdiDirectorySignature (fmt)Ian Jackson2025-10-091-7/+10
|
* tor-netdoc: parse2: Replace EP with AE in NdiDirectorySignatureIan Jackson2025-10-091-4/+4
|
* tor-netdoc: Abolish now-obsolete field argument to from_args (fmt)Ian Jackson2025-10-094-29/+7
|
* tor-netdoc: Abolish now-obsolete field argument to from_argsIan Jackson2025-10-097-20/+11
|
* tor-netdoc: Introduce ArgumentError (fmt)Ian Jackson2025-10-091-3/+1
|
* tor-netdoc: Introduce ArgumentErrorIan Jackson2025-10-099-33/+84
| | | | | This will allow us to (1) move field name handling out of the argument parser method, and also (2) add columns more easily.
* tor-netdoc: Have .reject_extra_args return a bespoke errorIan Jackson2025-10-093-4/+19
| | | | | | | We're about to have some functions return ArgumentError and some ErrorProblem. We don't want to provide a conversion directly between these types, so instead introduce a new type that will be convertible to either.
* tor-netdoc: UnparsedItem: Provide .args() accessorIan Jackson2025-10-091-0/+7
|
* tor-netdoc: parse2: Record previous position in ArgumentStream (fmt)Ian Jackson2025-10-091-1/+5
|
* tor-netdoc: parse2: Record previous position in ArgumentStreamIan Jackson2025-10-091-1/+8
|
* tor-netdoc: parse2: Rename methods on ArgumentStreamIan Jackson2025-10-092-10/+15
|
* tor-netdoc: parse2: Add whole_line_len to ArgumentStreamIan Jackson2025-10-092-4/+17
|
* tor-netdoc: Introduce `NormalItemArgument` impl-enabler traitIan Jackson2025-10-085-2/+8
| | | | | This is currently used to enable `parse2::ItemArgumentParseable`. In a moment it will enable `build::ItemArgument` too.
* tor-netdoc: parse2 poc: impl Display for several typesIan Jackson2025-10-084-3/+9
|
* tor-netdoc: parse2 poc: break out some constantsIan Jackson2025-10-081-3/+8
| | | | | We'll want this for both types eventually, when we do printing at the very least.
* tor-netdoc: impl Display for Fingerprint and Base64FingerprintIan Jackson2025-10-081-1/+1
| | | | | | | | I'm going to want this as preparation for making these things properly suitable for item arguments. One test case in parse2::poc was relying on Display of the Deref to RsaIdentity.
* tor-netdoc: parse2: Make NetdocParseableFields work out of-moduleIan Jackson2025-10-061-0/+9
|
* tor-netdoc: parse2: Break out check_no_objectIan Jackson2025-10-062-1/+9
| | | | This will be useful for impls of ItemValueParseable.
* tor-netdoc: parse2: Fix ItemValueParseable field attribute `with`Ian Jackson2025-10-062-2/+2
| | | | | According to the docs this is supposed to name the module, not the function. (This will be necessary when we do netdoc generation.)
* netdoc parse2 tests: Avoid <String as TryFrom<Vec<u8>>> (3)Ian Jackson2025-09-291-1/+1
|