summaryrefslogtreecommitdiff
path: root/crates/tor-bytes
Commit message (Collapse)AuthorAgeFilesLines
* Bump versions of internal arti crates for Arti 1.3.2Nick Mathewson2025-01-071-3/+3
| | | | | | | | | | | | | The affected crates follow our regular versioning. They all get bumped to 0.26.0. Done with ``` for crate in $(./maint/list_crates |grep '^arti-\|tor-' ); do cargo set-version --bump minor -p $crate; done ```
* clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* Bump all the unstable tor- and arti- crates to 0.25.0.Gabriela Moldovan2024-12-021-3/+3
| | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.25.0 done ```
* Bump the versions of the non-{arti-,tor-} crates.Gabriela Moldovan2024-12-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The non-{arti-,tor-} crates are: ``` ./maint/list_crates | rg -v '^(tor|arti)' oneshot-fused-workaround slotmap-careful test-temp-dir fslock-guard hashx equix caret fs-mistrust safelog retry-error ``` We split them in the following categories: * crates with no changes (no version bumps): ``` maint/changed_crates -v "arti-v$LAST_VERSION" 2>&1 >/dev/null | grep -i "no change" | grep -v '\(tor\|arti\)-' oneshot-fused-workaround: No change. test-temp-dir: No change. caret: No change. ``` * crates that only have non-functional changes (bump the patch version): - slotmap-careful - fslock-guard - hashx - equix - fs-mistrust - safelog - retry-error * crates where APIs were broken (bump minor): None The bumps from this commit were created using this script: ``` PATCH=" slotmap-careful fslock-guard hashx equix fs-mistrust safelog retry-error " for crate in $PATCH; do cargo set-version --bump patch -p $crate; done ```
* cargo: Update `thiserror` to `2`Clara Engler2024-11-121-1/+1
|
* Remove obsolete semver files post 1.3.0 releaseIan Jackson2024-10-311-1/+0
|
* Merge branch 'versions' into 'main'Ian Jackson2024-10-301-4/+4
|\ | | | | | | | | Version bumps for release of 1.3.0 See merge request tpo/core/arti!2599
| * Bump minor versions of crates with new APIs/implsIan Jackson2024-10-301-1/+1
| | | | | | | | | | cargo set-version --bump=patch -p slotmap-careful cargo set-version --bump=patch -p safelog
| * Bump unstable tor-* and arti-* crates to 0.24.0Ian Jackson2024-10-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cargo set-version -p tor-async-utils 0.24.0 cargo set-version -p tor-basic-utils 0.24.0 cargo set-version -p tor-bytes 0.24.0 cargo set-version -p tor-cell 0.24.0 cargo set-version -p tor-cert 0.24.0 cargo set-version -p tor-chanmgr 0.24.0 cargo set-version -p tor-checkable 0.24.0 cargo set-version -p tor-circmgr 0.24.0 cargo set-version -p tor-config 0.24.0 cargo set-version -p tor-config-path 0.24.0 cargo set-version -p tor-consdiff 0.24.0 cargo set-version -p tor-dirclient 0.24.0 cargo set-version -p tor-dirmgr 0.24.0 cargo set-version -p tor-error 0.24.0 cargo set-version -p tor-general-addr 0.24.0 cargo set-version -p tor-geoip 0.24.0 cargo set-version -p tor-guardmgr 0.24.0 cargo set-version -p tor-hsclient 0.24.0 cargo set-version -p tor-hscrypto 0.24.0 cargo set-version -p tor-hsrproxy 0.24.0 cargo set-version -p tor-hsservice 0.24.0 cargo set-version -p tor-key-forge 0.24.0 cargo set-version -p tor-keymgr 0.24.0 cargo set-version -p tor-linkspec 0.24.0 cargo set-version -p tor-llcrypto 0.24.0 cargo set-version -p tor-log-ratelim 0.24.0 cargo set-version -p tor-memquota 0.24.0 cargo set-version -p tor-netdir 0.24.0 cargo set-version -p tor-netdoc 0.24.0 cargo set-version -p tor-persist 0.24.0 cargo set-version -p tor-proto 0.24.0 cargo set-version -p tor-protover 0.24.0 cargo set-version -p tor-ptmgr 0.24.0 cargo set-version -p tor-relay-crypto 0.24.0 cargo set-version -p tor-relay-selection 0.24.0 cargo set-version -p tor-rpcbase 0.24.0 cargo set-version -p tor-rtcompat 0.24.0 cargo set-version -p tor-rtmock 0.24.0 cargo set-version -p tor-socksproto 0.24.0 cargo set-version -p tor-units 0.24.0 cargo set-version -p arti-client 0.24.0 cargo set-version -p arti-relay 0.24.0 cargo set-version -p arti-rpc-client-core 0.24.0 cargo set-version -p arti-rpcserver 0.24.0
* | cargo: Run fixup-featuresIan Jackson2024-10-301-1/+1
|/ | | | | | | This is output from nailing-cargo -Eu run -p fixup-features Cargo.toml There are some formatting glitches which I'll fix in a moment.
* tor-bytes: Make "tor-llcrypto" dependency optional.Nick Mathewson2024-10-093-3/+16
| | | | | | This is part of an effort to make arti-rpc-client-core (and future similar tools) able to use our very-low-level crates without depending on things they don't need.
* tor-bytes: Restore the message for Error::TruncatedIan Jackson2024-10-011-1/+1
| | | | | This variant is deprecated but it still ought to have a message so long as it exists.
* Remove semver.md files from 1.2.8Nick Mathewson2024-09-301-2/+0
|
* Bump arti- and tor- crates to 0.23.0Nick Mathewson2024-09-301-3/+3
| | | | | | | | | | | | | | Per our policy, every one of these gets a minor bump. Generated with: ``` for crate in $(./maint/list_crates | grep '^\(tor\|arti\)-' ); do cargo set-version --bump minor -p $crate; done ``` (Note the use of `-` at the end end of the grep pattern to prevent matching the `arti` crate.)
* Minor bumps on non-tor/arti cratesNick Mathewson2024-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates are not in the tor/arti namespace, but we have given them MSRV bumps: ``` oneshot-fused-workaround slotmap-careful fslock-guard hashx equix caret fs-mistrust safelog test-temp-dir retry-error ``` We are counting this as a breaking change. Since all of these crates are at 0.x.x, we have indicated the breaking change with a minor version bump. This commit was generated with the following script: ``` BUMPS=" oneshot-fused-workaround slotmap-careful fslock-guard hashx equix caret fs-mistrust safelog test-temp-dir retry-error " for crate in $BUMPS; do cargo set-version --bump minor -p $crate; done ```
* Upgrade MSRV to 1.77Nick Mathewson2024-09-251-1/+1
| | | | This will allow us to upgrade to the latest version of rusqlite.
* Run fixup-features in preparation for upcoming release.Nick Mathewson2024-09-251-1/+1
|
* Bump MSRV from 1.70 to 1.75.Wesley Aptekar-Cassels2024-09-161-1/+1
|
* tor-proto: Use Reader::take_all_but().Nick Mathewson2024-09-161-13/+14
|
* tor-bytes: Add a new take_all_but method.Nick Mathewson2024-09-161-0/+73
|
* tor-bytes: Fix Truncated refs in various docs.Ian Jackson2024-09-121-4/+5
| | | | | | Use "throws" terminology to avoid having to clutter the description with Err(). Many of these doc comments contain otiose text such as "returns Ok(()) on success" but let's not deal with that now.
* tor-bytes: Rename OnIncomplete to Completeness (fmt)Ian Jackson2024-09-121-1/+1
|
* tor-bytes: Rename OnIncomplete to CompletenessIan Jackson2024-09-121-11/+20
| | | | | | | | And rename its variants and update the docs to contemplate wider use, as suggested in #1620. As discussed here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075658
* tor_bytes: Clarify a method docIan Jackson2024-09-121-2/+3
| | | | | Apropos https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075638
* tor_bytes: Rename new_truncated_for_test to new_incomplete_for_testIan Jackson2024-09-122-14/+14
| | | | No semver implications since this wasn't in the last release.
* tor-bytes: Add test case for from_possibly_incomplete_sliceIan Jackson2024-09-121-0/+8
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075486
* tor-bytes: Add note about other kinds of invalid messageIan Jackson2024-09-111-0/+11
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075485
* tor-bytes: Add imprecations about Incomplete and MissingDataIan Jackson2024-09-111-0/+17
| | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075483
* tor-bytes: Fix a doc comment about error reportingIan Jackson2024-09-111-1/+1
| | | | This was a leftover from before I invented Error::MissingData.
* tor-bytes: Do many missed renames of Truncated to IncompleteIan Jackson2024-09-113-9/+9
|
* tor-bytes: Add warning about sub-readers (adjust to new name)Ian Jackson2024-09-111-1/+1
| | | | | Fix semantic conflict of the suggested edit with the rename later in the branch.
* tor-bytes: Add warning about sub-readersIan Jackson2024-09-111-0/+9
| | | | | Suggestion from here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2407#note_3075481
* tor-bytes: Update semver.md. No compile-breaking changes, now.Ian Jackson2024-09-111-1/+2
|
* tor-bytes: Rename Truncated to Incomplete, and restore old Truncated as ↵Ian Jackson2024-09-112-5/+10
| | | | | | | | | deprecated Incomplete is a better name. This lets us use Truncated for the old, deprecated, conflation of "Incomplete" with what is now "MissingData".
* tor-bytes: Only report Truncated for errors at the outer level (fmt)Ian Jackson2024-09-111-2/+10
|
* tor-bytes: Only report Truncated for errors at the outer levelIan Jackson2024-09-112-12/+30
| | | | | | | | | | | This is item 1 from https://gitlab.torproject.org/tpo/core/arti/-/issues/1614#note_3074562 and the alternative to item 2 presented in the 2nd half of https://gitlab.torproject.org/tpo/core/arti/-/issues/1614#note_3074648 (Item 3 was done earlier, but now we change the behaviour.) Fixes #1614.
* tor-bytes: Error: provide and call Error::incomplete_error (tidy)Ian Jackson2024-09-111-4/+1
| | | | | Tidy up an error message. Now this can be on one line with variable name interpolation.
* tor-bytes: Error: provide and call Error::incomplete_error (fmt)Ian Jackson2024-09-112-8/+11
|
* tor-bytes: Error: provide and call Error::incomplete_errorIan Jackson2024-09-112-9/+21
| | | | | | | | | | | | | | | | | | | We introduce the new constructor and call it at the error generation sites. But there is still not yet any functional change. Change the type of Truncated's field to be Sensitive. The original reason for not doing this no longer applies, since we don't generally want to open-code construction of this variant. Conveniently, changing the type means we get to find all the sites where one *is* constructed and adjust them. In reader.rs and tor-proto we can just call incomplete_error. In tor-cell, there's a call site where we previously provided an underestimate, and where the Reader isn't available. We adjust that ad-hoc but this is fine because the error variant will change. (relaycell is using a Reader from from_slice.)
* tor-bytes: Add a Reader constructor for tor-socksproto's use caseIan Jackson2024-09-111-3/+23
| | | | | | | Here we add the constructor, and document it, and change the call sites. No functional change yet.
* tor-bytes: Add a test case with missing inner dataIan Jackson2024-09-111-0/+9
| | | | Some tests in other crates test this, but none in tor-bytes!
* tor-bytes: Add a Reader constructor for use in testsIan Jackson2024-09-113-17/+29
| | | | | | | | | | | | We could call from_possibly_incomplete_slice in these, but that's confusing and distracting. Here we add this constructor, and document it (in terms of the constructor to come), and change the call sites. No functional change. Doing this now will prevent unwanted changes to test behaviours when we change the behaviour of Readers made by Reader::from_slice.
* tor-bytes: derive impl PartialEq for ErrorIan Jackson2024-09-112-17/+28
| | | | | | | I just perpetrated a bug by adding a variant to this which ended up not PartialEq to itself. This open-coded match is a footgun. No functional change.
* Change tor_bytes::Readable name to `b` in many placesIan Jackson2024-09-113-142/+142
| | | | | | | | | | | | | | | The codebase uses `r` sometimes and `b` at other times. Making this consistent makes widespread changes easier, and is clearer for humans. I think `b` is better than `r` because `r` might be "return". It is indeed used that way in a couple of places in reader.rs, even. I haven't changed *everywhere*, just Readable impls (where `r` is particularly likely to be "return value") and occurrences in tor-bytes. No functional change.
* tor-bytes: Error::Truncated: mark the deficit as Sensitive (fmt)Ian Jackson2024-09-101-2/+4
|
* tor-bytes: Error::Truncated: mark the deficit as SensitiveIan Jackson2024-09-102-1/+7
| | | | | Suggested in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2390#note_3072975
* tor-bytes: Add a deficit field to Error::Truncated (fmt)Ian Jackson2024-09-101-1/+3
|
* tor-bytes: Add a deficit field to Error::TruncatedIan Jackson2024-09-103-8/+15
| | | | This will allow us to fix #1592, but it doesn't do so yet.
* Introduce and use tor_bytes::Error::new_truncated_for_testIan Jackson2024-09-102-11/+26
| | | | | | | | This is going to want to do something more complicated (as described in the docs). In this commit we change all the tests that are expecting Truncated errors. That reduces noise in the next commit.