[−][src]Trait git_odb::Write
Describe the capability to write git objects into an object store.
Associated Types
type Error: Error + From<Error>
[src][−]
The error type used for all trait methods.
Note the default implementations require the From<io::Error>
bound.
Required methods
pub fn write_stream(
&self,
kind: Kind,
size: u64,
from: impl Read,
hash: HashKind
) -> Result<Id, Self::Error>
[src][−]
&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.
Provided methods
pub fn write(&self, object: &Object, hash: HashKind) -> Result<Id, Self::Error>
[src][−]
Write object
using the given kind of hash
into the database,
returning id to reference it in subsequent reads.
pub fn write_buf(
&self,
object: Kind,
from: &[u8],
hash: HashKind
) -> Result<Id, Self::Error>
[src][−]
&self,
object: Kind,
from: &[u8],
hash: HashKind
) -> Result<Id, Self::Error>
As write
, but takes an object
kind along with its encoded bytes.