summaryrefslogtreecommitdiffstats
path: root/vendor/gix-utils/src/lib.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
commit018c4950b9406055dec02ef0fb52f132e2bb1e2c (patch)
treea835ebdf2088ef88fa681f8fad45f09922c1ae9a /vendor/gix-utils/src/lib.rs
parentAdding debian version 1.75.0+dfsg1-5. (diff)
downloadrustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.tar.xz
rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-utils/src/lib.rs')
-rw-r--r--vendor/gix-utils/src/lib.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/vendor/gix-utils/src/lib.rs b/vendor/gix-utils/src/lib.rs
index 4c9d99fa4..f5951b104 100644
--- a/vendor/gix-utils/src/lib.rs
+++ b/vendor/gix-utils/src/lib.rs
@@ -6,3 +6,20 @@
///
pub mod backoff;
+
+///
+pub mod buffers;
+
+/// A utility to do buffer-swapping with.
+///
+/// Use `src` to read from and `dest` to write to, and after actually changing data, call [Buffers::swap()].
+/// To be able to repeat the process, this time using what was `dest` as `src`, freeing up `dest` for writing once more.
+///
+/// Note that after each [`Buffers::swap()`], `src` is the most recent version of the data, just like before each swap.
+#[derive(Default, Clone)]
+pub struct Buffers {
+ /// The source data, as basis for processing.
+ pub src: Vec<u8>,
+ /// The data produced after processing `src`.
+ pub dest: Vec<u8>,
+}