| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
| |
Now we use all the imports. We're still adding much code, though.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This is a bit subtle. Ignored is used where we want to see and accept
a value (for example, an Item or an Object), but we don't want to emit
it.
Update the docs and implement the various traits. We need an
uninhabited helper type which implements ItemValueEncodable and
ItemObjectEncodable but *not* ItemArgument. That prevents the use of
Ignored for an argument, which would be wrong because what would we
emit to keep the argument parser in step?
|
| |
|
|
|
|
|
| |
Per the type-level docs for NotPresent: it's is a placeholder type
mostly used when the document variety doesn't have this field.
When encoding it, we emit nothing.
|
| |
|
|
|
|
|
|
| |
This is quite like the one for parse2, but separate for Reasons.
Also add a bit of explanation to parse2's multiplicity.rs, about why
there are all these different FooSetMethods traits, which the encoder
doesn't need.
|
| |
|
|
| |
And implement them for Void and tuples, as applicable.
|
| |
|
|
|
| |
Adding these all at the beginning helped me with churn in this branch.
The allow(unused) will go away again shortly.
|
| |
|
|
|
|
|
| |
When we implemented this we documented it for ItemValueParseable but
forgot to do so for NetdocParseable.
Add some xrefs to the traits to try to stop similar mistakes.
|
| |
|
|
|
|
|
|
|
| |
Fixes part of #2193.
(Edits from nickm: I selected the cases here that I could verify
were correct from immediate context.)
Edited-by: Nick Mathewson <[email protected]>
|
| |
|
|
|
|
|
|
|
| |
This commit implements directory authority certificates using the
`parse2` approaches.
For now, those are in a module `doc::authcert::tmp`, with the eventual
goal of moving it into its super module after removing/deprecating the
legacy types.
|
| | |
|
| |\
| |
| |
| |
| | |
Make Protocols type inherently interned; add notes about usage.
See merge request tpo/core/arti!3524
|
| | |
| |
| |
| | |
(It's now done in tor_protover.)
|
| | | |
|
| | | |
|
| |\ \
| | |
| | |
| | |
| | | |
tor-netdoc: Store n_authorities in usize
See merge request tpo/core/arti!3522
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously, this value was stored in a u16. However, because this
number is usually always derived from some sort of list type, such as
`Vec`, it makes more sense to use usize for this, as it avoid
unnecessary casting and error checking.
|
| | | |
| | |
| | |
| | |
| | | |
This provides a way to explicitly consume the encoder and finish the
item, without use of mem::drop.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The new derive is going to want this. So it would need to be at least
`#[doc(hidden)]`. But it makes sense to expose it.
But, it had a weird signature. Make its signature like that of `.arg_empty()`.
(Note that an ItemEncoder contains just a `&mut NetdocEncoder`.)
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
These cannot be encoded. So that is logically incoherent.
(Perhaps String ought not to be NormalItemArgument, but let's not
tackle that now.)
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | | |
talking about the "keyword argument syntax" makes it sound a bit like
its' the *keyword* that is wrong.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
NormalItemArgument is for types where we use the Display as the netdoc
argument formatter. But what if gives the empty string?
Previously we would allow `add_arg` to handle the error. That would
record it in the NetdocEncoder. That's kind of OK, but it will
prevent the caller from aborting early (and from elaborating the error).
|
| | | | |
|
| | | | |
|
| | |/
|/|
| |
| |
| |
| |
| | |
This code sometimes expands to `let item = item;`. That's OK.
In derive-deftly 1.5.x the two `item` wrongly had different hygiene
span so the warning didn't trigger.
|
| | |
| |
| |
| |
| | |
As per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3502/diffs?commit_id=f9a6d90ec6d5abf2958534d2c100c84f325e3634#2525aaf11b44162850101813478c4734160e11fa_920_919
|
| | |
| |
| |
| |
| |
| | |
The error is not really discarded (which would seem to mean ignoring
it). The erorr *value* is discarded and is replaced with a less
informative error value.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The path in `with` must always be a module, not a function, because we
need to use it for encoding too.
In the case of `rest`, it's probably sensible to require a different
function name, given that the semantics are subtly different to those
of `rest` without `with`, since the latter can only get a single word
but with `rest` you get the whole line.
|
| |/ |
|
| | |
|
| |
|
|
| |
This silences a new warning on nightly.
|
| |
|
|
|
|
|
|
|
|
|
| |
This commit moves the "Naming Convention" of the parse2::poc module into
the respective module, as it does not apply to parse2 itself, as
outlined in arti!3462.
With this commit, there remains `NdaSystemTimeDeprecatedSyntax` as the
only type outside poc following this naming schema. However, because it
is more or less already deprecated anyways, there is no real need to
bother with it any further.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
This is in the ItemValueParseable derive, so the individual fields are
Arguments, not Items.
|
| | |
|
| |\
| |
| |
| |
| | |
tor-netdoc: Parameterise RelayFlagsParser by an options trait instead
See merge request tpo/core/arti!3489
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
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.)
|
| | |
| |
| |
| | |
The generic parser type is easy enough to name now.
|
| | |
| |
| |
| |
| |
| |
| | |
This avoids a lot of messing about with const generics.
Suggested by the author of enumset:
https://github.com/Lymia/enumset/issues/74#issuecomment-3561337369
|
| |\ \
| | |
| | |
| | |
| | | |
tor-netdoc: Move parse2/test.rs to test2.rs
See merge request tpo/core/arti!3486
|
| | | |
| | |
| | |
| | | |
Tidy up the imports.
|
| | | |
| | |
| | |
| | |
| | |
| | | |
Now that this module is not inside parse2 its identifier namespace
oughtn't to be parse-specific. Rename things so that every
imports/aliases related to parsing implies parsing in its name.
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
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: parse2: Combine MultiplicitySelector
See merge request tpo/core/arti!3478
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
as per
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3478#note_3291482
encode::MultiplicitySelector doesn't actually exist yet in this
branch, but it will do. Don't mention that fact as we'll probably
just forget to update this comment...
|
| | | | |
|
| | | |
| | |
| | |
| | |
| | |
| | | |
The encoder is going to need to have a different
MultiplicitySelector (just because of different variance, really)
so we mustn't import it under this name.
|