pub struct Blob<'repo> {
pub id: ObjectId,
pub data: Vec<u8>,
pub repo: &'repo Repository,
}Expand description
A blob along with access to its owning repository.
Fields§
§id: ObjectIdThe id of the tree
data: Vec<u8>The blob’s data.
repo: &'repo RepositoryThe owning repository.
Implementations§
Source§impl Blob<'_>
Remove Lifetime
impl Blob<'_>
Remove Lifetime
Sourcepub fn detached(&self) -> ObjectDetached
pub fn detached(&self) -> ObjectDetached
Create an owned instance of this object, copying our data in the process.
Sourcepub fn detach(self) -> ObjectDetached
pub fn detach(self) -> ObjectDetached
Sever the connection to the Repository and turn this instance into a standalone object.
Trait Implementations§
Source§impl<'repo> From<Blob<'repo>> for ObjectDetached
impl<'repo> From<Blob<'repo>> for ObjectDetached
Source§impl WriteTo for Blob<'_>
Note that the data written here might not correspond to the id of the Blob anymore if it was modified.
Also, this is merely for convenience when writing empty blobs to the ODB. For writing any blob, use
Repository::write_blob().
impl WriteTo for Blob<'_>
Note that the data written here might not correspond to the id of the Blob anymore if it was modified.
Also, this is merely for convenience when writing empty blobs to the ODB. For writing any blob, use
Repository::write_blob().
Auto Trait Implementations§
impl<'repo> Freeze for Blob<'repo>
impl<'repo> !RefUnwindSafe for Blob<'repo>
impl<'repo> !Send for Blob<'repo>
impl<'repo> !Sync for Blob<'repo>
impl<'repo> Unpin for Blob<'repo>
impl<'repo> UnsafeUnpin for Blob<'repo>
impl<'repo> !UnwindSafe for Blob<'repo>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more