RepositoryAccess

Trait RepositoryAccess 

Source
pub trait RepositoryAccess:
    Send
    + Sync
    + Clone {
Show 13 methods // Required methods fn get_repository_refs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>, ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn has_object<'life0, 'life1, 'async_trait>( &'life0 self, object_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn get_object<'life0, 'life1, 'async_trait>( &'life0 self, object_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn store_pack_data<'life0, 'life1, 'async_trait>( &'life0 self, pack_data: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; fn update_reference<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ref_name: &'life1 str, old_hash: Option<&'life2 str>, new_hash: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<(), ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait; fn get_objects_for_pack<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, wants: &'life1 [String], haves: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn has_default_branch<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool, ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn post_receive_hook<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn get_blob<'life0, 'life1, 'async_trait>( &'life0 self, object_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Blob, ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn get_commit<'life0, 'life1, 'async_trait>( &'life0 self, commit_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Commit, ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn get_tree<'life0, 'life1, 'async_trait>( &'life0 self, tree_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Tree, ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn commit_exists<'life0, 'life1, 'async_trait>( &'life0 self, commit_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn handle_pack_objects<'life0, 'async_trait>( &'life0 self, commits: Vec<Commit>, trees: Vec<Tree>, blobs: Vec<Blob>, ) -> Pin<Box<dyn Future<Output = Result<(), ProtocolError>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}
Expand description

Repository access trait for storage operations

This trait only handles storage-level operations, not Git protocol details. The git-internal library handles all Git protocol formatting and parsing.

Required Methods§

Source

fn get_repository_refs<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<(String, String)>, ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get repository references as raw (name, hash) pairs

Source

fn has_object<'life0, 'life1, 'async_trait>( &'life0 self, object_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if an object exists in the repository

Source

fn get_object<'life0, 'life1, 'async_trait>( &'life0 self, object_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get raw object data by hash

Source

fn store_pack_data<'life0, 'life1, 'async_trait>( &'life0 self, pack_data: &'life1 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Store pack data in the repository

Source

fn update_reference<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ref_name: &'life1 str, old_hash: Option<&'life2 str>, new_hash: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<(), ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Update a single reference

Source

fn get_objects_for_pack<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, wants: &'life1 [String], haves: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Get objects needed for pack generation

Source

fn has_default_branch<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<bool, ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if repository has a default branch

Source

fn post_receive_hook<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Post-receive hook after successful push

Provided Methods§

Source

fn get_blob<'life0, 'life1, 'async_trait>( &'life0 self, object_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Blob, ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get blob data by hash

Default implementation parses the object data using the internal object module. Override this method if you need custom blob handling logic.

Source

fn get_commit<'life0, 'life1, 'async_trait>( &'life0 self, commit_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Commit, ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get commit data by hash

Default implementation parses the object data using the internal object module. Override this method if you need custom commit handling logic.

Source

fn get_tree<'life0, 'life1, 'async_trait>( &'life0 self, tree_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Tree, ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get tree data by hash

Default implementation parses the object data using the internal object module. Override this method if you need custom tree handling logic.

Source

fn commit_exists<'life0, 'life1, 'async_trait>( &'life0 self, commit_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check if a commit exists

Default implementation checks object existence and validates it’s a commit. Override this method if you have more efficient commit existence checking.

Source

fn handle_pack_objects<'life0, 'async_trait>( &'life0 self, commits: Vec<Commit>, trees: Vec<Tree>, blobs: Vec<Blob>, ) -> Pin<Box<dyn Future<Output = Result<(), ProtocolError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle pack objects after unpacking

Default implementation stores each object individually using store_pack_data. Override this method if you need batch processing or custom storage logic.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§