[][src]Struct git_odb::loose::Object

pub struct Object {
    pub kind: Kind,
    pub size: usize,
    // some fields omitted
}

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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]

impl<T> Pipe for T where
    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

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,