| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
| |
This makes it possible to derive from a struct with deprecated fields,
without triggering the warning.
This doesn't yet treat encoding as yet, because the only deprecated
field I encountered was `skip` which means the derived encoder never
mentions it.
|
| | |
|
| |
|
|
|
| |
Prompted by
https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/4070#note_3422636
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apparently, it is only correct to write
[`NetdocParseableUnverified`](derive_deftly_template_NetdocParseableUnverified),
*after* the definition of that template. Before then, the macro isn't
in scope.
Worse, rustdoc just treats it as a filename and doesn't spot the link,
so you don't get any kind of warning. I think this is an upstream bug,
https://github.com/rust-lang/rust/issues/157304
I found rustdoc's behaviour capricious. I don't intend to go through
the arti tree right now looking for similar patterns. Instead let's
hope the upstream bug gets fixed, and in the meantime do this crate::
thing when we notice we need it.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
The NetdocParseableUnverified derive macro implements this
trait (amongst other things). Traits and derive macros should have
aligned names.
This is only used for parsing, so let's keep the "Parseable" part of
the name.
I don't think the effort of deprecated alias, for downstream
compatibility, is worth it, our compatibility policy notwithstanding.
|
| |
|
|
|
|
|
| |
The trait is called NetdocUnverified, but the template is
NetdocParseableUnverified. This fixes a dead docs link (which somehow
isn't spotted by rustdoc, but is instead taken to refer to a
nonexistent file).
|
| | |
|
| |
|
|
| |
ns_type! is a non-path type.
|
| | |
|
| |
|
|
| |
We'll want this with Constructor's __non_exhaustive.
|
| |\
| |
| |
| |
| | |
Add debugging support to ItemValueParseable derive
See merge request tpo/core/arti!3881
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With
cargo test --all-features -p tor-netdoc -- --no-capture test2
the output now contains, amongst many other things:
netdoc TestItem parse: item start, "test-item", "N", Some("TEST OBJECT")
netdoc TestItem parse: field needed, normal, args=1, "N"
netdoc TestItem parse: field optional, normal, args=Option<_>, ""
netdoc TestItem parse: field rest, normal, args=Vec<_>, ""
netdoc TestItem parse: field object, object, object=1, Some(("TEST OBJECT", Ok(5)))
netdoc TestItem parse: item complete Ok
|
| | | |
|
| | |
| |
| |
| | |
So far this just abolishes a duplicate P.
|
| | |
| |
| |
| |
| |
| |
| | |
We're going to want tio reuse dtrace from here in the
ItemValueParseable derive (which doesn't use
NetdocSomeItemsParseableCommon because it derives for one item type,
not a document containing multiple items).
|
| | | |
|
| | |
| |
| |
| | |
Ie for "arguments" that don't actually appear.
|
| | |
| |
| |
| |
| |
| | |
This can't trigger, but when messing about with some new features,
I messed up and got a syntax error here. Let's try this feature out,
here.
|
| |/
|
|
| |
No functional change.
|
| |\
| |
| |
| |
| | |
tor-netdoc: Three fixes to parsing and encoding
See merge request tpo/core/arti!3862
|
| | | |
|
| | | |
|
| |/
|
|
|
|
|
|
|
|
|
| |
The `doctype_for_error` attribute needs immediate adjustment, because
a string expression value is expected. With `quoted retain`, that
would be re-interpreted, silently. This kind of thing is why
`quoted rigorous` exists.
So change its docs and the one use site.
The macros' docs, and the other calls ites, we'll deal with shortly.
|
| |
|
|
| |
No change to the generated docs.
|
| |
|
|
| |
Typos found with codespell
|
| | |
|
| |
|
|
| |
Suggested-by: Clara Engler <[email protected]>
|
| | |
|
| |
|
|
| |
I have been losing my way in this file a lot. This may help.
|
| |
|
|
| |
Such an impl is a footgun. Explain this in docs & comments.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace the two separate NetdocParseable and NetdocUnverified derives,
for toplevel signed documents, with a single derive.
This makes the derive API simpler. It will also make it reasonably
possible to avoid deriving NetdocParseable directly for body structs.
Such impls are a security hazard!
In detail:
* Rename NetdocUnverified to NetdocParseableUnverified
* Have it use $IMPL_NETDOC_PARSEABLE from the NetdocParseable deftly
module so that it derives NetdocParseable for the body.
(We'll change this later in the series.)
* Adjust the docs and all call sites.
|
| |
|
|
|
| |
We are going to want to reuse this parsing implementation in another
top-level deftly template.
|
| |
|
|
|
|
|
|
|
|
| |
During encoding, including these hashes in the signature items makes
no sense. The hashes are an *input* to the signature items, but not
part of them.
Move the hashes out of the items. Instead, provide each signatures
section type with a hash accumulator type, in which the hash(es) are
stored.
|
| |
|
|
|
| |
Nonfunctional and formatting changes which reduce noise in the next
commit.
|
| |
|
|
| |
This is going to contain body information, and the hashes, too.
|
| | |
|
| |
|
|
|
|
| |
This is going to be its own trait and it is usually best if macros are
named after traits, rather than having the macro derive a different
trait depending on meta attributes.
|
| |
|
|
| |
For reuse when we split up the NetdocParseable derive.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
This was a weird name, and while working in this area it all seemed to
make the docs strange.
Rename it. This is quite invasive!
In theory we could have the macros generate compatibility aliases, but
that seems quite complex.
|
| |
|
|
| |
Roughly as per the proposal in `doc/dev/notes/authcert-in-consensus.md`.
|
| |
|
|
|
| |
This lets us having document items that are "manually non exhaustive"
which is necessary for struct literal constructors.
|
| |
|
|
| |
This was missed, apparently.
|
| |
|
|
|
| |
Signature encoding is not yet supported. We need to consider how this
will work.
|
| |
|
|
|
|
|
|
| |
We want to recognise `#[deftly(netdoc(debug))]` because otherwise we
have to make lots of these attributes conditional.
So, implement it for *all* the derives, providing a nugatory debug
statement.
|