[−][src]Struct git_odb::loose::object::Object
A representation of a loose object on disk, which is fully or partially read into memory
Fields
kind: Kind
The kind of object
size: usize
The uncompressed size of the object's data/payload
Implementations
impl Object
[src][−]
pub fn decode(&mut self) -> Result<Object<'_>, Error>
[src][−]
Decode the object to make it's fields accessible in case of Trees, Tags and Commits.
This is a zero-copy operation with data read from disk if needed and stored in memory.
The returned borrowed::Object
references this data where possible.
Note: Blobs are also loaded into memory and are made available that way.
Consider using stream()
if large Blobs are expected.
pub fn stream(&mut self) -> Result<Reader<'_>, Error>
[src][−]
Returns an implementation of std::io::Read
, which decompresses the objects data on the fly.
Note: This is most useful for big blobs as these won't be read into memory in full. Use decode()
for
Trees, Tags and Commits instead for convenient access to their payload.
impl Object
[src][−]
pub fn verify_checksum(&mut self, desired: Id<'_>) -> Result<(), Error>
[src][−]
Generate the git hash of this object, reading it in the process, and compare it with the given desired
Id.
Returns an error with the actual id if the hashes don't match.
Trait Implementations
impl Clone for Object
[src][+]
impl Debug for Object
[src][+]
impl Eq for Object
[src]
impl Hash for Object
[src][+]
impl Ord for Object
[src][+]
impl PartialEq<Object> for Object
[src][+]
impl PartialOrd<Object> for Object
[src][+]
impl StructuralEq for Object
[src]
impl StructuralPartialEq for Object
[src]
Auto Trait Implementations
impl RefUnwindSafe for Object
[src]
impl Send for Object
[src]
impl Sync for Object
[src]
impl Unpin for Object
[src]
impl UnwindSafe for Object
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> Conv for T
[+]
impl<T> Conv for T
[+]
impl<T> FmtForward for T
[+]
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T> Pipe for T where
T: ?Sized,
[+]
T: ?Sized,
impl<T> Pipe for T
[+]
impl<T> PipeAsRef for T
[+]
impl<T> PipeBorrow for T
[+]
impl<T> PipeDeref for T
[+]
impl<T> PipeRef for T
[+]
impl<T> Tap for T
[+]
impl<T> Tap for T
[+]
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
[+]
U: ?Sized,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
[+]
U: ?Sized,
impl<T> TapDeref for T
[+]
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T> TryConv for T
[+]
impl<T> TryConv for T
[+]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[+]
V: MultiLane<T>,