Trait git_repository::prelude::Write
source · [−]pub trait Write {
type Error: Error + From<Error>;
fn write_stream(
&self,
kind: Kind,
size: u64,
from: impl Read
) -> Result<ObjectId, Self::Error>;
fn write(&self, object: impl WriteTo) -> Result<ObjectId, Self::Error> { ... }
fn write_buf(
&self,
object: Kind,
from: &[u8]
) -> Result<ObjectId, Self::Error> { ... }
}
Expand description
Describe the capability to write git objects into an object store.
Associated Types
Required methods
Provided methods
Write objects using the intrinsic kind of hash
into the database,
returning id to reference it in subsequent reads.
Implementations on Foreign Types
sourceimpl Write for Store
impl Write for Store
type Error = Error
fn write(
&self,
object: impl WriteTo
) -> Result<ObjectId, <Store as Write>::Error>
fn write_buf(
&self,
object: Kind,
from: &[u8]
) -> Result<ObjectId, <Store as Write>::Error>
fn write_stream(
&self,
kind: Kind,
size: u64,
from: impl Read
) -> Result<ObjectId, <Store as Write>::Error>
sourceimpl Write for Store
impl Write for Store
sourcefn write_buf(
&self,
kind: Kind,
from: &[u8]
) -> Result<ObjectId, <Store as Write>::Error>
fn write_buf(
&self,
kind: Kind,
from: &[u8]
) -> Result<ObjectId, <Store as Write>::Error>
Write the given buffer in from
to disk in one syscall at best.
This will cost at least 4 IO operations.
sourcefn write_stream(
&self,
kind: Kind,
size: u64,
from: impl Read
) -> Result<ObjectId, <Store as Write>::Error>
fn write_stream(
&self,
kind: Kind,
size: u64,
from: impl Read
) -> Result<ObjectId, <Store as Write>::Error>
Write the given stream in from
to disk with at least one syscall.
This will cost at least 4 IO operations.