Skip to main content

RemoteRepo

Enum RemoteRepo 

Source
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§

§

File

Fields

§path: PathBuf
§

Http

Fields

§base_url: String
§

Ssh

Fields

§

Lit

Implementations§

Source§

impl RemoteRepo

Source

pub fn open(url: &str) -> Result<Self, String>

Create a RemoteRepo from a URL, auto-detecting transport type

Source

pub fn list_refs(&self, kind: &str) -> Result<Vec<RemoteRef>, String>

List refs (branches and/or tags) on the remote

Source

pub fn list_branches(&self) -> Result<Vec<(String, String)>, String>

List branches on the remote (convenience method)

Source

pub fn read_branch_ref(&self, branch: &str) -> Result<String, String>

Read a branch ref on the remote

Source

pub fn read_head(&self) -> Result<String, String>

Read HEAD from the remote

Source

pub fn update_branch_ref( &self, branch: &str, hash: &str, force: bool, ) -> Result<(), String>

Update a branch ref on the remote

Source

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)

Source

pub fn download_objects( &self, local_store: &ObjectStore, hashes: &[ObjectHash], ) -> Result<usize, String>

Download objects from remote into local store

Source

pub fn upload_objects( &self, local_store: &ObjectStore, hashes: &[ObjectHash], ) -> Result<usize, String>

Upload objects from local store to remote

Source

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)

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.