Trait gix::prelude::Write

source ·
pub trait Write {
    // Required method
    fn write_stream(
        &self,
        kind: Kind,
        size: u64,
        from: &mut dyn Read
    ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>;

    // Provided methods
    fn write(
        &self,
        object: &dyn WriteTo
    ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>> { ... }
    fn write_buf(
        &self,
        object: Kind,
        from: &[u8]
    ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>> { ... }
}
Expand description

Describe the capability to write git objects into an object store.

Required Methods§

source

fn write_stream( &self, kind: Kind, size: u64, from: &mut dyn Read ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

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

Provided Methods§

source

fn write( &self, object: &dyn WriteTo ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

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

source

fn write_buf( &self, object: Kind, from: &[u8] ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

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

Implementations on Foreign Types§

source§

impl<T> Write for &Twhere T: Write,

source§

fn write( &self, object: &dyn WriteTo ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

source§

fn write_buf( &self, object: Kind, from: &[u8] ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

source§

fn write_stream( &self, kind: Kind, size: u64, from: &mut dyn Read ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

source§

impl<T> Write for Arc<T, Global>where T: Write,

source§

fn write( &self, object: &dyn WriteTo ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

source§

fn write_buf( &self, object: Kind, from: &[u8] ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

source§

fn write_stream( &self, kind: Kind, size: u64, from: &mut dyn Read ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

source§

impl<T> Write for Rc<T, Global>where T: Write,

source§

fn write( &self, object: &dyn WriteTo ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

source§

fn write_buf( &self, object: Kind, from: &[u8] ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

source§

fn write_stream( &self, kind: Kind, size: u64, from: &mut dyn Read ) -> Result<ObjectId, Box<dyn Error + Send + Sync, Global>>

Implementors§

source§

impl Write for Store

source§

impl Write for Sink

source§

impl<S> Write for Handle<S>where S: Deref<Target = Store> + Clone,

source§

impl<S> Write for Cache<S>where S: Write,