aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-netdoc: testing: Expose assert_eq_or_diffIan Jackson2026-07-301-3/+4
| | | | Involves lots of code motion. Review with --color-moved.
* tor-netdoc: testing: Actually expose the test_support moduleIan Jackson2026-07-301-1/+1
| | | | I discovered this didn't work, when I tried to use it.
* tor-netdoc testdata-live: Export for the benefit of other cratesIan Jackson2026-07-231-0/+2
| | | | | | | | Add a new testdata_live module which is exposed with the testing features, containing the testdata-live in string constants. This avoids the need for test cases in other crates to walk the filesystem to an area outside their own crate path.
* tor-netdoc: Break out and expose parse_testcase_from_netdocIan Jackson2026-07-211-0/+6
|
* add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
|
* Removed unnecessary lintpryty262026-07-151-1/+1
| | | | Removed unnecessary lint
* tor-netdoc: rangemap_mutate_range: New functionIan Jackson2026-07-021-0/+2
| | | | This will be used for exit port summary calculations.
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+2
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* tor-netdoc: Rename FixedString to ConstantStringIan Jackson2026-05-271-1/+1
| | | | | | | | 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-1/+1
| | | | We're going to want quite a lot of this for eg network-status-version.
* tor-netdoc: Move FromStr and Display from NormalItemArgument to implsIan Jackson2026-04-291-3/+5
| | | | | | | | | | | This allows implementing NormalItemArgument for types that can only be parsed, or only displayed - or other combinations. I noticed this restriction while inventing a type I later decided was unnecessary. I still think it's a good change. There is no practical impact elsewhere, since in practice downstream code implements NormalItemArgument rather than relying on it.
* tor-netdoc: Un-gate test2 moduleIan Jackson2026-04-281-1/+1
| | | | Everything that this needs is un-gated now.
* tor-netdoc: Un-gate top-level NetdocBuilderIan Jackson2026-04-281-2/+0
| | | | | This is only used for hsdescs right now. But it doesn't need to be gated behind encode.
* tor-netdoc: Un-gate parse2 and encode coreIan Jackson2026-04-231-2/+0
|
* tor-netdoc: Provide AsMutSelf derive macroIan Jackson2026-03-191-1/+2
| | | | We're going to want this for sets of netdoc signature hashes.
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* tor-netdoc: Provide AuthCertConstructorIan Jackson2026-01-131-1/+0
|
* tor-netdoc: test2: implement encoding traits for all test typesIan Jackson2025-12-101-1/+1
| | | | | | | Make this whole module conditional on the encode feature. Apply the derives. Provide the necessary manual implementations for the types where we use `with`.
* tor-netdoc: Break out netdoc_ordering_check into new derive_common.rsIan Jackson2025-12-101-0/+3
|
* tor-netdoc: Drop the allow(unused)Ian Jackson2025-12-101-1/+0
| | | | Now we use all the imports. We're still adding much code, though.
* tor-netdoc: Add imports to encode module, for new encode deriveIan Jackson2025-12-101-0/+2
| | | | | Adding these all at the beginning helped me with churn in this branch. The allow(unused) will go away again shortly.
* tor-netdoc: Move parse2/test.rs to test2.rsIan Jackson2025-11-241-0/+3
| | | | | | | 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.
* tor-netdoc: Make much more of the encode module contents publicIan Jackson2025-11-181-1/+1
| | | | | My planned new derive for encoding will be pub, but cfg gated, like parse2 is.
* 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 traitIan Jackson2025-11-181-0/+8
| | | | | My planned encoding derive macro is not going to use `decl_keyword!` but will need to call `NetdocEncoder::item`.
* tor-netdoc: Introduce "encode" feature for the like-named moduleIan Jackson2025-11-101-3/+3
| | | | | | | We're going to introduce facilities for encoding more generally, and we'll want a way to enable them. Instead, have a separate feature for *encoding* documents.
* tor-netdoc: Rename the `build` module to `encode`Ian Jackson2025-11-101-2/+2
| | | | | The word "build" so often in Rust means builder pattern. This module contains functions for encoding.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-2/+2
| | | | Run maint/add_warning
* tor-netdoc: Reference `build::ItemArgument` from `NoramlItemArgument` docIan Jackson2025-10-211-1/+2
| | | | | | Since 9ce85acb3ab0d1a0b1be6ef0f10707983f4362a3 tor-netdoc: replace impl_item_argument_as_display with NormalItemArgument this trait impl has implications for encoding as well as parsing.
* tor-netdoc: Introduce `NormalItemArgument` impl-enabler traitIan Jackson2025-10-081-0/+28
| | | | | This is currently used to enable `parse2::ItemArgumentParseable`. In a moment it will enable `build::ItemArgument` too.
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* neteoc parse2: Import earlierIan Jackson2025-09-291-2/+3
| | | | | This is needed if we want to use these macros in `doc`, which we're going to.
* tor-netdoc: Introduce parse2, new parserIan Jackson2025-08-141-0/+5
| | | | | This isn't used anywhere yet. We're going to demonstrate it, and test the demo, in a moment.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* protover, *: Add documentation about what "supported" means.Nick Mathewson2025-04-161-1/+2
|
* Add warnings about removing supported protocols.Nick Mathewson2025-04-161-0/+2
|
* New functions to report supported subprotocolsNick Mathewson2025-04-161-0/+41
| | | | | | | | | | | | | | | Part of #1849. Note that these functions are distributed across crates, so that if (in the future) we stop doing API breaks with every release, we will get the right outputs. Note also that these functions build the list of protocols out of specific symbolic features, rather than numbers: this makes it easier to avoid errors about "which feature was Relay=4 again", and easier to avoid accidentally referring to a protocol that doesn't exist, like "Consensus" (should be "Cons") or "HsDir" (case is wrong).
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* Disable a lot of dead code warningsIan Jackson2024-10-171-0/+3
| | | | | | | Now cargo check --workspace --no-default-features --all-targets cargo build -p arti --no-default-features --features=memquota,tokio,native-tls are both clean.
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Run maint/add_warning to actually apply new lint allowsIan Jackson2023-07-101-0/+1
|
* Run add_warning to remove `missing_panics_doc` deny.Nick Mathewson2023-07-061-1/+0
| | | | Closes #950.
* lints: Run maint/add_warning to actually apply new lintsIan Jackson2023-06-211-0/+2
|
* netdoc: Rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`.Gabriela Moldovan2023-05-101-1/+1
| | | | | | | | | | | `ParseErrorSource` was originally meant to represent a parsing error, this enum has since gained some variants that aren't really parsing related (`Signature`, `CertSignature`, `UntimelyDescriptor`). Since this error type is now used for general-purpose netdoc errors, let's rename `ParseError{Kind, Source}` to `NetdocError{Kind, Source}`. Signed-off-by: Gabriela Moldovan <[email protected]>
* Remove `NetdocText` and replace its uses with `String`.Gabriela Moldovan2023-03-241-1/+1
| | | | | | | | `NetdocText` is a wrapper around a `String` and a type marker. The type annotation proved of limited use, and made the netdoc builder API somewhat awkward to use. Signed-off-by: Gabriela Moldovan <[email protected]>
* Add builder for encoding hidden service descriptors.Gabi Moldovan2023-03-241-1/+1
| | | | | | | | | | | | | | This introduces the `NetdocBuilder` trait described in `netdoc-builder.md` and a new `tor-netdoc::doc::hsdesc::build` module, which exports the `HsDescBuilder`. Hidden services will use `HsDescBuilder` to build and encode hidden service descriptors. There are several TODOs in the code that I'm planning to address separately. Partially addresses #745. Signed-off-by: Gabriela Moldovan <[email protected]>