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§
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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 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
Sourcefn 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,
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§
Sourcefn 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_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.
Sourcefn 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_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.
Sourcefn 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 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.
Sourcefn 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 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.
Sourcefn 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,
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.