| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
This allows implementing NormalItemArgument for types that can only be
parsed, or only displayed - or other combinations.
I noticed this restriction while inventing a type I later decided was
unnecessary. I still think it's a good change.
There is no practical impact elsewhere, since in practice downstream
code implements NormalItemArgument rather than relying on it.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Otherwise deriving NetdocEncodable doesn't work outside this crate.
|
| |
|
|
|
|
|
|
|
|
|
| |
With the introduction of the derives for document encoding, we now
have a trait ItemObjectEncodable. We will want a method on
ItemEncoder that takes an ItemObjectEncodable, and that should be
called `object` since it's a better approach than working ad-hoc with
tor_bytes::Writeable. (For example, an ItemObjectEncodable knows its
own label.)
So, rename `object` to `object_bytes`.
|
| | |
|
| | |
|
| |
|
|
|
| |
Signature encoding is not yet supported. We need to consider how this
will work.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
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`.)
|
| | |
|
| |
|
|
|
| |
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).
|
| | |
|
| |
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
| |
clippy points out that if argument-less `new` can exist, so should
Default.
|
| |
|
|
|
| |
My planned new derive for encoding will be pub, but cfg gated, like
parse2 is.
|
| | |
|
| |
|
|
|
| |
My planned encoding derive macro is not going to use `decl_keyword!`
but will need to call `NetdocEncoder::item`.
|
|
|
The word "build" so often in Rust means builder pattern. This module
contains functions for encoding.
|