pub struct GitObject {
pub obj_type: ObjectType,
pub content: Vec<u8>,
}Expand description
A git object with type and content
Fields§
§obj_type: ObjectType§content: Vec<u8>Implementations§
Source§impl GitObject
impl GitObject
pub fn new(obj_type: ObjectType, content: Vec<u8>) -> Self
pub fn blob(content: Vec<u8>) -> Self
pub fn id(&self) -> ObjectId
Sourcepub fn to_loose_format(&self) -> Vec<u8> ⓘ
pub fn to_loose_format(&self) -> Vec<u8> ⓘ
Serialize to loose object format (for storage)
Sourcepub fn from_loose_format(data: &[u8]) -> Result<Self>
pub fn from_loose_format(data: &[u8]) -> Result<Self>
Parse from loose object format
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GitObject
impl RefUnwindSafe for GitObject
impl Send for GitObject
impl Sync for GitObject
impl Unpin for GitObject
impl UnwindSafe for GitObject
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)