| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
EnumSet<RelayFlag> implements PartialEq, so we can derive this rather
than open-coding it.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
The only thing generated by this macro is `set_iter_keywords` which
is only used in the test to check that the macro call is correct.
Abolish it all.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
This existed because it was once an impl on the old RelayFlags.
Now, it's on RelayFlag which is sensibly FromStr.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Abolish the constants with the transitional names.
This also abolishes the controversial name `H_S_DIR`, which Rust case
transformation rules generated from `HSDir`.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Now:
`RelayFlag` is a single flag, which is a different type to
`RelayFlags`.
`FromStr` and `Display` are now implemented in a normal way for a
single flag.
We don't use bitflags, with its funky input syntax, any more.
Instead, we have a normal enum.
No longer is it possible to have a `RelayFlags` with "unknown bits"
set (whatever that means). (Therefore, an associated test case for
this is now gone.)
The names are principally specified just as enum variant names. The
enum variant names can be identical to the network document keywords.
Briefly, we provide constants in capitals, for the benefit of all the
call sites. That means that *this* commit can contain only the
primary changes.
A few macro-generated things have been adjusted in this commit, but
they are actually going to go away.
Indentation is now wrong. We'll fix that at the end.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
This will reduce noise in the actual functional change commit.
(But, this is all going to go away. That will bei justified on its
merits, after the overhaul is done.)
|
| | | |
| | |
| | |
| | |
| | | |
bitflags provides .bits() but enumset provides .as_repr().
Make this change at all call sites now.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |/ /
| |
| |
| |
| |
| |
| |
| | |
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.)
|
| | | |
|
| | |
| |
| |
| | |
Some of the new formatting is a bit unfortunate. Ah well.
|
| | |
| |
| |
| |
| | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3454#note_3288967
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
There are currently no options.
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
I would do `#[deprecated]` but empirically that has no effect...
|
| | |
| |
| |
| | |
This will have space for unknown flags.
|
| | |
| |
| |
| | |
This is the minimal change to provide sanity.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently the only exposed API for parsing RelayFlags is the FromStr
impl which is very strange. I'm going to remove it. But there should
be a replacement.
So improve RelayFlagsParser:
* Derive Debug and Clone.
* Replace the `&'static str` error.
* Make sure unknown `IMPLIED | IMPLICIT` is detected at compile time.
* Make it pub.
|
| | |
| |
| |
| |
| | |
Provide a per-variety alias and use it for parsing; no longer impl
ItemValueParseable for RelayFlags.
|
| | |
| |
| |
| | |
Which bits are implied/omitted depends on the document!
|
| | | |
|
| | | |
|
| | |
| |
| |
| | |
The API is a bit clumsy, but we're mostly going to use it internally.
|
| | | |
|
| | |
| |
| |
| |
| | |
Add underscores so that the spec keywords and the flag constants
correspond (according to `paste`'s case-changing rules).
|
| | |
| |
| |
| |
| |
| |
| | |
* Document the bizarre FromStr impl. That isn't in my way, so I
don't intend to fix it. So I've documented it instead.
* Mention the naming discrepancy.
|
| | |
| |
| |
| |
| | |
We're going to do a lot more with this and it's less confusing to have
it all together.
|
| |\ \
| | |
| | |
| | |
| | | |
tor-netdoc: parse2 More deduplication of the derive macro
See merge request tpo/core/arti!3455
|
| | | |
| | |
| | |
| | |
| | | |
This can result in "trait not implemented" errors here. Use the
`${paste_spanned}` trick.
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Move what is now IF_NONSTRUCTURAL_ACCUMULATE into the common module.
It's not yet suitable for reuse.
The docs for ACCUMULATE_ITEM_VALUE are still wrong. We'll fix that in
a moment.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
This was previously only not done because of the need to c&p.
Also, we're going to be expanding some common macros that will use it.
|
| | | |
| | |
| | |
| | | |
The hygiene is fixed in derive-deftly 1.5.x.
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |/ /
| |
| |
| |
| | |
The word "build" so often in Rust means builder pattern. This module
contains functions for encoding.
|
| |\ \
| | |
| | |
| | |
| | | |
tor-netdoc: parse2 derive: Some deduplication
See merge request tpo/core/arti!3450
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Have the module expect the use site to determine (mostly) the field
kind. Document this expectation.
Now NetdocParseableCommon can have the keyword-related definitions.
|