summaryrefslogtreecommitdiffstats
path: root/vendor/gix-utils/src/lib.rs
diff options
context:
space:
mode:
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>,
+}