summaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* tor-netdoc: Rename ItemArgument method to write_arg_ontoIan Jackson2025-11-261-3/+3
| | | | | | | 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: Rename RelayFlagsParser to relay_flags::ParserIan Jackson2025-11-242-2/+2
| | | | | | | 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-242-6/+5
| | | | The generic parser type is easy enough to name now.
* 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
| |
* | Merge branch 'pub-encode' into 'main'Ian Jackson2025-11-193-4/+4
|\ \ | | | | | | | | | | | | tor-netdoc: Make much more of encode module public See merge request tpo/core/arti!3471
| * | tor-netdoc: Split off Keyword::to_str into its own traitIan Jackson2025-11-183-4/+4
| | | | | | | | | | | | | | | My planned encoding derive macro is not going to use `decl_keyword!` but will need to call `NetdocEncoder::item`.
* | | RelayFlags: Use RelayFlag enum variant names everywhereIan Jackson2025-11-182-11/+11
| | | | | | | | | | | | | | | | | | | | | Abolish the constants with the transitional names. This also abolishes the controversial name `H_S_DIR`, which Rust case transformation rules generated from `HSDir`.
* | | RelayFlags: Use the singular RelayFlag for naming individual flagsIan Jackson2025-11-183-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're going to separate RelayFlag from RelayFlags. We could continue to provide a bunch of constant values for RelayFlags, for each individual type, but that would involve an ad-hoc derive, and would still be a bit of an unusual API. Instead, we're going to make ``RelayFlag` a normal enum. In this commit, we change everyone to refer to it by its singular name. Hopefully separating out this bulk change makes both this, and the core commit, easier to review.
* | | tor-netdoc: rs builder: Take Into<RelayFlags>Ian Jackson2025-11-181-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Many call sites pass one flag. We're going to have a type-level distinction between a single flag and a set. But that's annoying at many of the call sites which want to specify a fixed single flag. Note that `set_flags` doesn't only set flags. It replaces them.
* | | tor-netdoc: RelayFlags: Tidy up from_item for flagsIan Jackson2025-11-181-1/+3
|/ / | | | | | | | | | | | | | | Implement this on DocRelayFlags instead, since that's what it returns. And change the name to from_item_consensus to highlight its semantic restriction. (It's not generic over the implied flags, so it can only do one thing.)
* | tor-netdoc: Be able to retain unknown flagsIan Jackson2025-11-183-2/+3
| |
* | tor-netdoc: parse2: Introduce ParseInput intermediate structIan Jackson2025-11-181-2/+3
| | | | | | | | | | | | | | We're going to add options arguments, effectively, to the parsing entrypoints. To avoid a proliferation of entrypoints (eg, parse_multiple_with_options), encapsulate the run-time input values in this structure.
* | tor-netdoc: Remove the RelayFlags type alias in netstatusIan Jackson2025-11-181-3/+0
| | | | | | | | I would do `#[deprecated]` but empirically that has no effect...
* | tor-netdoc: Introduce DocRelayFlags for relay flags in a network documentIan Jackson2025-11-185-5/+9
| | | | | | | | This will have space for unknown flags.
* | tor-netdoc: Separate ConsensusRelayFlagsParser and VoteRelayFlagsParserIan Jackson2025-11-182-1/+9
| | | | | | | | | | Provide a per-variety alias and use it for parsing; no longer impl ItemValueParseable for RelayFlags.
* | tor-netdoc: Rename RelayFlags elements for regularity vs specIan Jackson2025-11-182-3/+3
| | | | | | | | | | Add underscores so that the spec keywords and the flag constants correspond (according to `paste`'s case-changing rules).
* | tor-netdoc: Move RelayFlags into its own moduleIan Jackson2025-11-181-161/+3
| | | | | | | | | | We're going to do a lot more with this and it's less confusing to have it all together.
* | Apply deferred rustfmt churnIan Jackson2025-11-103-4/+4
| |
* | tor-netdoc: Rename the `build` module to `encode`Ian Jackson2025-11-103-4/+4
| | | | | | | | | | 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-0616-16/+16
|/ | | | Run maint/add_warning
* tor-netdoc: Abolish ArgumentNotPresent alias, completing the renameIan Jackson2025-10-231-1/+1
|
* tor-netdoc: Use NotPresent rather than Option<Ignored> to suppress fieldsIan Jackson2025-10-234-8/+8
|
* tor-netdoc: Preamble: Fix garbled doc commentIan Jackson2025-10-221-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3378#note_3277957
* tor-netdoc: Preamble: rename relay_version field to server_versionIan Jackson2025-10-223-8/+8
| | | | This makes it match the protocol and the spec.
* tor-netdoc: Say Preamble doesn't contain vote-status, in summary.Ian Jackson2025-10-221-1/+1
|
* tor-netdoc: Explain that Preamble doesn't contain vote-status either.Ian Jackson2025-10-221-1/+1
|
* tor-netdoc: netstatus: Preamble: Name the protocols fields in docIan Jackson2025-10-221-0/+2
|
* tor-netdoc: netstatus: Preamble: rename shared rand fields to match docIan Jackson2025-10-223-18/+18
| | | | | We should use the same name everywhere, even if the name in the spec is clumsy (as it is here).
* tor-netdoc: Move ConsensusFlavor into Consensus structIan Jackson2025-10-223-14/+22
| | | | | | We're going to want to apply the parse2 derive to Preamble, but this field is anomalous. Rather than trying to make it regular, simply move it to the old-parser-specific Consensus struct.
* tor-netdoc: Declare intent not to apply parse2 to ConsensusIan Jackson2025-10-221-4/+1
| | | | | | | Consensus is not going to be easy to square with parse2 - especially, signature handling is very different between the two parsers. Instead, we'll have a new NetworkStatus type.
* tor-netdoc: Rename consensus Header to PreambleIan Jackson2025-10-224-40/+42
| | | | | There is no such thing as the "header" according to the spec. We mean the preamble.
* Merge branch 'p2-shared-rand-status' into 'main'Ian Jackson2025-10-223-10/+26
|\ | | | | | | | | impl ItemValueParseable for SharedRandStatus See merge request tpo/core/arti!3380
| * tor-netdoc: impl ItemValueParseable for SharedRandStatusIan Jackson2025-10-211-0/+1
| |
| * tor-netdoc: impl Display, FromStr, NormalItemArgument for SharedRandValIan Jackson2025-10-211-2/+18
| |
| * tor-netdoc: Change type of timestamp in SharedRandStatus (fmt)Ian Jackson2025-10-211-2/+1
| |
| * tor-netdoc: Change type of timestamp in SharedRandStatusIan Jackson2025-10-213-7/+7
| |
* | tor-netdoc: Lifetime impls: reindentIan Jackson2025-10-211-37/+37
| |
* | tor-netdoc: derive NetdocParseableFields for LifetimeIan Jackson2025-10-211-0/+4
| |
* | tor-netdoc: Lifetime: change type of fieldsIan Jackson2025-10-212-8/+8
| | | | | | | | These fields aren't public so this doesn't have semver impacts.
* | tor-netdoc: Lifetime: derive constructor and accessorsIan Jackson2025-10-211-20/+17
| | | | | | | | | | | | | | | | | | | | | | In a moment, we're going to want to transform the field arguments. That would leave us open to bugs like this: valid_after: valid_after.into(), fresh_until: fresh_until.into(), valid_until: valid_after.into(), We'll sort out the indentation later in this branch.
* | tor-netdoc: Lifetime: Move some documentation to fieldsIan Jackson2025-10-211-10/+10
| | | | | | | | | | This (briefly) regresses the documentation, but it's going to appear again when we derive the methods.
* | tor-netdoc: Lifetime: Construct Lifetime struct earlierIan Jackson2025-10-211-6/+10
|/
* tor-netdoc: Add a lot of spec cross-references and tidy docsIan Jackson2025-10-153-15/+101
| | | | | | | | | | | | | Add links to torspec, and other cross-references. Change heading fof `IgnoredPublicationTimeSp` to `publication` to match spec and distinguish it from the `published` item in netstatus docs. Align several descriptions with the wording from torspec. Remove a restatement of a fact from the spec, on the `valid_until` field in `Lifetime`.
* tor-netdoc: Typo fixes in docsIan Jackson2025-10-152-2/+2
|
* tor-netdoc: tests: Print out vote routerstatusIan Jackson2025-10-151-1/+2
| | | | | | | I have eyeballed the output and it seems to look right. Eventually we'll have encoing code and then we'll be able to check that things round-trip.
* tor-netdoc: tests: Move vote parsing test to netstatus.rsIan Jackson2025-10-151-0/+21
| | | | | This is a test of real document structs now, albeit that it still uses one of the types from `poc`.
* tor-netdoc: impl parse2 for RouterStatus entryIan Jackson2025-10-152-1/+85
|