pub trait Write {
// Required method
fn write_stream(
&self,
kind: Kind,
size: u64,
from: &mut dyn Read,
) -> Result<ObjectId, Box<dyn Error + Send + Sync>>;
// Provided methods
fn write(
&self,
object: &dyn WriteTo,
) -> Result<ObjectId, Box<dyn Error + Send + Sync>> { ... }
fn write_buf(
&self,
object: Kind,
from: &[u8],
) -> Result<ObjectId, Box<dyn Error + Send + Sync>> { ... }
}Expand description
Describe the capability to write git objects into an object store.
Required Methods§
Provided Methods§
Implementations on Foreign Types§
Source§impl Write for Store
impl Write for Store
Source§fn write_buf(
&self,
kind: Kind,
from: &[u8],
) -> Result<ObjectId, Box<dyn Error + Send + Sync>>
fn write_buf( &self, kind: Kind, from: &[u8], ) -> Result<ObjectId, Box<dyn Error + Send + Sync>>
Write the given buffer in from to disk in one syscall at best.
This will cost at least 4 IO operations.
Source§fn write_stream(
&self,
kind: Kind,
size: u64,
from: &mut dyn Read,
) -> Result<ObjectId, Box<dyn Error + Send + Sync>>
fn write_stream( &self, kind: Kind, size: u64, from: &mut dyn Read, ) -> Result<ObjectId, Box<dyn Error + Send + Sync>>
Write the given stream in from to disk with at least one syscall.
This will cost at least 4 IO operations.