aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc/netstatus/rs/md.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-netdoc: Stabilise votes and encoding of authcertsIan Jackson2026-07-151-1/+0
|
* tor-netdoc: derive encoding for RouterStatusIan Jackson2026-06-091-1/+0
|
* tor-netdoc: Implement encoding for md rs digestIan Jackson2026-05-181-0/+12
| | | | | This is not tested yet. It will be tested when we add round-trip tests for votes.
* tor-netdoc: Fix comment about from_unparsedIan Jackson2026-05-181-1/+1
| | | | This doesn't parse the keyword, only the value.
* tor-netdoc: Tidy doc_digest_parse2_m into doc_digest_item_mIan Jackson2026-05-181-1/+1
| | | | | | | | | * Rename it so that it doesn't mention parse2, because we're going to want to encode too. * Remove the indirection: rename the one in md.rs to be the name that's used in `with = `. (Previously, things were more complicated so the extra layer of indirection was helpful.)
* tor-netdoc: rs referenced doc digests: Use FixedB64 (fmt)Ian Jackson2026-05-181-2/+1
|
* tor-netdoc: rs referenced doc digests: Use FixedB64Ian Jackson2026-05-181-2/+2
| | | | | | | FixedB64 is the right type for these, when they are present. This abolishes some ad-hoc boilerplate. Sadly we still need a bit of that for Reasons.
* tor-netdoc: Fix comments in rs variety filesIan Jackson2026-05-181-1/+1
| | | | This is router *status* not router *descriptor*.
* tor-netdoc: Un-gate parse2 and encode loose impls under doc/netstatusIan Jackson2026-04-281-1/+0
| | | | | | | | | | | | | | | This stabilises the parse2 and encode impls of consensus tyepe: * {plain, md}::{Preamble, RouterStatus, RouterStatusIntroItem} It also un-gates the parse2 and encode impls of some vote types. * VoteAuthorityEntry - this type has been completed. * RouterStatusMdDigestsVote - whole type still gated with ns-vote Re the remaining vote types (vote::*): although each_variety.rs doesn't have a cfg itself, there is a feature gate in the variety macrology.
* tor-netdoc: impl parse2 for RouterStatus entryIan Jackson2025-10-151-0/+20
|
* tor-netdoc: Combine ConsensusRouterStatus and GenericRouterStatusIan Jackson2025-08-261-1/+1
| | | | Now we only need one type.
* tor-netdoc: Remove generics from Consensus and its contentsIan Jackson2025-08-261-1/+1
|
* tor-netdoc: Run rustfmt againIan Jackson2025-08-181-1/+1
| | | | Not sure how this is needed now, after rebase, but whatever.
* tor-netdoc: Rename "species" to "variety"Ian Jackson2025-08-181-1/+1
|
* tor-netdoc: Add commentary about namespacingIan Jackson2025-08-181-0/+6
|
* Revert "tor-netdoc: Link to the generated macro, for one of them (poc)"Ian Jackson2025-08-181-3/+0
| | | | This reverts commit 084ad9a716da8e44616a54fdfbba0140f5a7704e.
* tor-netdoc: Link to the generated macro, for one of them (poc)Ian Jackson2025-08-181-0/+3
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3139#note_3238496
* tor-netdoc: rs: Move identical text to per_species.rs.Ian Jackson2025-08-181-71/+2
| | | | | | | These two files were largely identical. Move the common text to per_species.rs, and fix a couple of imports so that it still compiles.
* tor-netdoc: rs: Remove some fiddly docs differencesIan Jackson2025-08-181-1/+1
| | | | | | | Not having the flavour in the type name is a shame, but we probably don't want to resort to generating the docs with macros. Part of making these two files largely identical.
* tor-netdoc: rs: Introduce FLAVOR constantIan Jackson2025-08-181-2/+5
| | | | Part of making these two files largely identical.
* tor-netdoc: rs: Swap calling orderIan Jackson2025-08-181-2/+2
| | | | | Move the implementation to the trait method which then becomes completely identical in both files.
* tor-netdoc: rs: Introduce and use DOC_DIGEST_LENIan Jackson2025-08-181-2/+2
| | | | Part of making ns.rs and md.rs largely identical.
* tor-netdoc: rs: Use species macrology for DocDigestIan Jackson2025-08-181-9/+9
| | | | Part of making these two files largely identical.
* tor-netdoc: rs: Use species macrology for ConsensusRouterStatusIan Jackson2025-08-181-10/+10
| | | | | | | In the species-specific files ns.rs and md.rs, use the unqualified name; re-export it with the new macro. We are working towards making these two files largely identical.
* tor-netdoc: Introduce new "species" macrologyIan Jackson2025-08-181-0/+2
| | | | | This will let us deduplicate a fair amount of code, and also will let us support votes as well as ns and md consensuses.
* tor-netdoc: Remove two false commentsIan Jackson2025-08-181-1/+0
| | | | Cut-and-paste error, I think.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-1/+1
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Work around a new nightly clippy warningNick Mathewson2022-09-301-1/+1
| | | | | | | | | | | | | | The warning `clippy::bool_to_int_with_if` is meant to shout at you when you say `if x { 1 } else { 0 }` and instead suggest that you say `inttype::from(x)`. I agreed with this for the case in tor-cert, where we are literally converting a boolean into a flag. I don't agree with this in tor-netdoc, where we are using a boolean to decide how many fields to skip in a given document format. So for this case, I decided to clean up the code a little by renaming "skip" to "n_skip", and changing the boolean to use an enum instead.
* add feature annotation to fields made visible through visible::StructFieldstrinity-1686a2022-08-241-0/+1
|
* squash! Bump every crate's edition to 2021.Nick Mathewson2022-04-251-1/+0
| | | | | Remove all `use` statements for `TryFrom` and `TryInto`. These are now redundant in Rust 2021.
* Re-order attributes so that we can build with Rust 1.53.Nick Mathewson2022-03-311-1/+1
|
* tor-netdoc: Conditionally expose document fields.Nick Mathewson2022-03-311-0/+5
| | | | | | | | This commit uses the `visibility` and `visible` crates to conditionally make certain structs and their fields public (respectively). This is incredibly dangerous to use for anything besides testing, and I've tried to write the documentation for the feature accordingly.
* Refactor tor_netdoc::ErrorNick Mathewson2022-02-141-2/+3
| | | | | | | | | | | | | | | This error type doesn't impement HasKind, since the kind will depend on context. However, the existing implementation was pretty messy and inconsistent: Some errors had positions, some didn't. Some took messages as str, some as String. Some had internal errors that were somewhat orthogonal to their actual types. This commit refactors tor_netdoc::Error to use a ParseErrorKind, and adds a set of convenience functions to add positions and messages to the errors that need them.
* tor-netdoc: Split the two kinds of routerstatus into their own modulesNick Mathewson2021-11-121-0/+77