gix_protocol::fetch

Struct RefMap

Source
pub struct RefMap {
    pub mappings: Vec<Mapping>,
    pub refspecs: Vec<RefSpec>,
    pub extra_refspecs: Vec<RefSpec>,
    pub fixes: Vec<Fix>,
    pub remote_refs: Vec<Ref>,
    pub object_hash: Kind,
}
Available on crate feature fetch only.
Expand description

Information about the relationship between our refspecs, and remote references with their local counterparts.

It’s the first stage that offers connection to the server, and is typically required to perform one or more fetch operations.

Fields§

§mappings: Vec<Mapping>

A mapping between a remote reference and a local tracking branch.

§refspecs: Vec<RefSpec>

The explicit refspecs that were supposed to be used for fetching.

Typically, they are configured by the remote and are referred to by refmap::SpecIndex::ExplicitInRemote in refmap::Mapping.

§extra_refspecs: Vec<RefSpec>

Refspecs which have been added implicitly due to settings of the remote, usually pre-initialized from extra_refspecs in RefMap options. They are referred to by refmap::SpecIndex::Implicit in refmap::Mapping.

They are never persisted nor are they typically presented to the user.

§fixes: Vec<Fix>

Information about the fixes applied to the mapping due to validation and sanitization.

§remote_refs: Vec<Ref>

All refs advertised by the remote.

§object_hash: Kind

The kind of hash used for all data sent by the server, if understood by this client implementation.

It was extracted from the handshake as advertised by the server.

Implementations§

Source§

impl RefMap

Source

pub fn new<T>( progress: impl Progress, fetch_refspecs: &[RefSpec], _: Context<'_, T>, _: Options, ) -> Result<Self, Error>
where T: Transport,

Available on crate features blocking-client or async-client only.

Create a new instance by obtaining all references on the remote that have been filtered through our remote’s for fetching.

A context is provided to bundle what would be additional parameters, and options are used to further configure the call.

  • progress is used if ls-refs is invoked on the remote. Always the case when V2 is used.
  • fetch_refspecs are all explicit refspecs to identify references on the remote that you are interested in. Note that these are copied to RefMap::refspecs for convenience, as RefMap::mappings refer to them by index.

Trait Implementations§

Source§

impl Clone for RefMap

Source§

fn clone(&self) -> RefMap

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RefMap

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RefMap

Source§

fn default() -> RefMap

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for RefMap

§

impl RefUnwindSafe for RefMap

§

impl Send for RefMap

§

impl Sync for RefMap

§

impl Unpin for RefMap

§

impl UnwindSafe for RefMap

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T