pub enum RemoteRepo {
File {
path: PathBuf,
},
Http {
base_url: String,
token: Option<String>,
},
Ssh {
pipe: RefCell<SshPipe>,
},
Lit {
conn: RefCell<LitConnection>,
},
}Expand description
A remote repository that can be accessed via filesystem, HTTP, SSH, or lit://
Variants§
Implementations§
Source§impl RemoteRepo
impl RemoteRepo
Sourcepub fn open(url: &str) -> Result<Self, String>
pub fn open(url: &str) -> Result<Self, String>
Create a RemoteRepo from a URL, auto-detecting transport type
Sourcepub fn list_refs(&self, kind: &str) -> Result<Vec<RemoteRef>, String>
pub fn list_refs(&self, kind: &str) -> Result<Vec<RemoteRef>, String>
List refs (branches and/or tags) on the remote
Sourcepub fn list_branches(&self) -> Result<Vec<(String, String)>, String>
pub fn list_branches(&self) -> Result<Vec<(String, String)>, String>
List branches on the remote (convenience method)
Sourcepub fn read_branch_ref(&self, branch: &str) -> Result<String, String>
pub fn read_branch_ref(&self, branch: &str) -> Result<String, String>
Read a branch ref on the remote
Sourcepub fn update_branch_ref(
&self,
branch: &str,
hash: &str,
force: bool,
) -> Result<(), String>
pub fn update_branch_ref( &self, branch: &str, hash: &str, force: bool, ) -> Result<(), String>
Update a branch ref on the remote
Sourcepub fn negotiate_download(
&self,
local_store: &ObjectStore,
wants: &[String],
) -> Result<Vec<ObjectHash>, String>
pub fn negotiate_download( &self, local_store: &ObjectStore, wants: &[String], ) -> Result<Vec<ObjectHash>, String>
Negotiate which objects need to be transferred (returns hashes of needed objects)
Sourcepub fn download_objects(
&self,
local_store: &ObjectStore,
hashes: &[ObjectHash],
) -> Result<usize, String>
pub fn download_objects( &self, local_store: &ObjectStore, hashes: &[ObjectHash], ) -> Result<usize, String>
Download objects from remote into local store
Sourcepub fn upload_objects(
&self,
local_store: &ObjectStore,
hashes: &[ObjectHash],
) -> Result<usize, String>
pub fn upload_objects( &self, local_store: &ObjectStore, hashes: &[ObjectHash], ) -> Result<usize, String>
Upload objects from local store to remote
Sourcepub fn negotiate_upload(
&self,
local_store: &ObjectStore,
wants: &[String],
remote_has: &HashSet<String>,
) -> Result<Vec<ObjectHash>, String>
pub fn negotiate_upload( &self, local_store: &ObjectStore, wants: &[String], remote_has: &HashSet<String>, ) -> Result<Vec<ObjectHash>, String>
Negotiate which objects need to be uploaded (walk local graph, exclude known remote objects)
Sourcepub fn check_fast_forward(
&self,
local_store: &ObjectStore,
new_hash: &ObjectHash,
old_hash: &ObjectHash,
) -> Result<bool, String>
pub fn check_fast_forward( &self, local_store: &ObjectStore, new_hash: &ObjectHash, old_hash: &ObjectHash, ) -> Result<bool, String>
Check if a push would be fast-forward
Auto Trait Implementations§
impl !Freeze for RemoteRepo
impl !RefUnwindSafe for RemoteRepo
impl !Sync for RemoteRepo
impl Send for RemoteRepo
impl Unpin for RemoteRepo
impl UnsafeUnpin for RemoteRepo
impl UnwindSafe for RemoteRepo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more