summaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/build.rs
Commit message (Collapse)AuthorAgeFilesLines
* Make the HS encoder randomness source injectable.Gabriela Moldovan2023-03-271-1/+2
| | | | | | | This makes it possible to plug in a deterministic randomness source for testing. Signed-off-by: Gabriela Moldovan <[email protected]>
* Remove `NetdocText` and replace its uses with `String`.Gabriela Moldovan2023-03-241-49/+6
| | | | | | | | `NetdocText` is a wrapper around a `String` and a type marker. The type annotation proved of limited use, and made the netdoc builder API somewhat awkward to use. Signed-off-by: Gabriela Moldovan <[email protected]>
* Add builder for encoding hidden service descriptors.Gabi Moldovan2023-03-241-2/+26
| | | | | | | | | | | | | | This introduces the `NetdocBuilder` trait described in `netdoc-builder.md` and a new `tor-netdoc::doc::hsdesc::build` module, which exports the `HsDescBuilder`. Hidden services will use `HsDescBuilder` to build and encode hidden service descriptors. There are several TODOs in the code that I'm planning to address separately. Partially addresses #745. Signed-off-by: Gabriela Moldovan <[email protected]>
* Implement `ItemArgument` for `String`.Gabriela Moldovan2023-03-241-0/+6
| | | | | | | This makes some code a bit more concise, as it allows us to make `Strings` into `ItemArgument`s without calling `.as_str()`. Signed-off-by: Gabriela Moldovan <[email protected]>
* Fix typosDimitris Apostolou2023-01-281-2/+2
|
* Allow clippy::unchecked_duration_subtraction in testsNick Mathewson2023-01-271-0/+1
| | | | | This panics on error, and we're fine with a panic on misbehavior in tests.
* netdoc builder: Add two TODOs, prompted by testing experienceIan Jackson2023-01-241-0/+6
|
* netdoc builder test: Make a bigger dummy document and test reparsingIan Jackson2023-01-241-2/+26
|
* netdoc builder: Implement object() and add one test caseIan Jackson2023-01-241-1/+50
|
* netdoc-builder: Initial test case (no object yet)Ian Jackson2023-01-241-0/+47
|
* netdoc-builder: Provide new() methodIan Jackson2023-01-241-0/+7
|
* netdoc-builder: Implement ItemArgument for more needed typesIan Jackson2023-01-241-5/+44
|
* netdoc-builder: Remove some obsolete commentsIan Jackson2023-01-241-11/+0
|
* netdoc-builder: Move example into implementation doc commentIan Jackson2023-01-241-2/+16
| | | | Not actually tested yet
* netdoc-builder: Implement most of the internal general doc builderIan Jackson2023-01-241-23/+83
|
* netdoc-builder api: Clarify docs for object()Ian Jackson2023-01-241-3/+8
|
* netdoc-builder api: Introduce ItemArgument traitIan Jackson2023-01-241-2/+32
|
* netdoc-builder api: Have .item() return ItemBuilderIan Jackson2023-01-241-1/+1
| | | | This was a slip in the design doc.
* netdoc-builder api: Abolish `K` generic on ItemEncoderIan Jackson2023-01-241-5/+7
| | | | | We're going to eagerly encode the keyword, so this will be easy. Removing the generic simplifies the API.
* netdoc-builder api: Don't promise to check args_raw_string valueIan Jackson2023-01-241-3/+0
|
* netdoc-builder api: Make ItemEncoder methods consume and return selfIan Jackson2023-01-241-2/+13
| | | | | | This will actually make the pattern in the example work. The mentioned `ItemArgument` trait will arrive soon.
* netdoc-builder api: Move internal API into actual code file (fmt)Ian Jackson2023-01-241-6/+7
|
* netdoc-builder api: Move internal API into actual code fileIan Jackson2023-01-241-0/+174
Motion, plus the bare minimum needed to make it compile.