pub struct Object<'a> {
pub kind: ObjectKind,
pub data: &'a [u8],
}Fields§
§kind: ObjectKind§data: &'a [u8]Implementations§
Source§impl<'a> Object<'a>
impl<'a> Object<'a>
Sourcepub fn from_loose(bytes: &'a [u8], expected: ObjectId) -> Result<Self>
pub fn from_loose(bytes: &'a [u8], expected: ObjectId) -> Result<Self>
Validate already inflated loose bytes before exposing a borrowed body. Header syntax, exact body length and the expected ID’s hash must all match. This checks the object’s envelope, not its commit/tree/tag semantics.
pub fn info(&self) -> ObjectInfo
pub fn header<'header>( &self, storage: &'header mut [u8], ) -> Result<&'header [u8]>
pub fn id(&self) -> ObjectId
pub fn id_with_format(&self, format: ObjectFormat) -> ObjectId
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Object<'a>
impl<'a> RefUnwindSafe for Object<'a>
impl<'a> Send for Object<'a>
impl<'a> Sync for Object<'a>
impl<'a> Unpin for Object<'a>
impl<'a> UnsafeUnpin for Object<'a>
impl<'a> UnwindSafe for Object<'a>
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