summaryrefslogtreecommitdiffstats
path: root/vendor/gix/src/types.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-07 05:48:48 +0000
commitef24de24a82fe681581cc130f342363c47c0969a (patch)
tree0d494f7e1a38b95c92426f58fe6eaa877303a86c /vendor/gix/src/types.rs
parentReleasing progress-linux version 1.74.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-ef24de24a82fe681581cc130f342363c47c0969a.tar.xz
rustc-ef24de24a82fe681581cc130f342363c47c0969a.zip
Merging upstream version 1.75.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix/src/types.rs')
-rw-r--r--vendor/gix/src/types.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/vendor/gix/src/types.rs b/vendor/gix/src/types.rs
index 0739cdd25..0dc81abae 100644
--- a/vendor/gix/src/types.rs
+++ b/vendor/gix/src/types.rs
@@ -31,6 +31,7 @@ pub struct Id<'r> {
}
/// A decoded object with a reference to its owning repository.
+#[derive(Clone)]
pub struct Object<'repo> {
/// The id of the object
pub id: ObjectId,
@@ -47,7 +48,24 @@ impl<'a> Drop for Object<'a> {
}
}
+/// A blob along with access to its owning repository.
+#[derive(Clone)]
+pub struct Blob<'repo> {
+ /// The id of the tree
+ pub id: ObjectId,
+ /// The blob's data.
+ pub data: Vec<u8>,
+ pub(crate) repo: &'repo Repository,
+}
+
+impl<'a> Drop for Blob<'a> {
+ fn drop(&mut self) {
+ self.repo.reuse_buffer(&mut self.data);
+ }
+}
+
/// A decoded tree object with access to its owning repository.
+#[derive(Clone)]
pub struct Tree<'repo> {
/// The id of the tree
pub id: ObjectId,
@@ -63,6 +81,7 @@ impl<'a> Drop for Tree<'a> {
}
/// A decoded tag object with access to its owning repository.
+#[derive(Clone)]
pub struct Tag<'repo> {
/// The id of the tree
pub id: ObjectId,
@@ -78,6 +97,7 @@ impl<'a> Drop for Tag<'a> {
}
/// A decoded commit object with access to its owning repository.
+#[derive(Clone)]
pub struct Commit<'repo> {
/// The id of the commit
pub id: ObjectId,