[][src]Trait git_odb::Write

pub trait Write {
    type Error: Error + From<Error>;
    fn write_stream(
        &self,
        kind: Kind,
        size: u64,
        from: impl Read,
        hash: HashKind
    ) -> Result<Id, Self::Error>; fn write(&self, object: &Object, hash: HashKind) -> Result<Id, Self::Error> { ... }
fn write_buf(
        &self,
        object: Kind,
        from: &[u8],
        hash: HashKind
    ) -> Result<Id, Self::Error> { ... } }

Associated Types

Loading content...

Required methods

fn write_stream(
    &self,
    kind: Kind,
    size: u64,
    from: impl Read,
    hash: HashKind
) -> Result<Id, Self::Error>

As write, but takes an input stream. This is commonly used for writing blobs directly without reading them to memory first.

Loading content...

Provided methods

fn write(&self, object: &Object, hash: HashKind) -> Result<Id, Self::Error>

Write object using the given kind of hash into the database, returning id to reference it in subsequent reads.

fn write_buf(
    &self,
    object: Kind,
    from: &[u8],
    hash: HashKind
) -> Result<Id, Self::Error>

As write, but takes an object kind along with its encoded bytes.

Loading content...

Implementors

impl Write for git_odb::compound::Db[src]

type Error = Error

impl Write for git_odb::loose::db::Db[src]

type Error = Error

impl Write for Sink[src]

type Error = Error

Loading content...