Skip to main content

LocalRefs

Trait LocalRefs 

Source
pub trait LocalRefs {
    // Required method
    fn tips(&self) -> Result<Vec<(String, ObjectId)>>;
}
Expand description

The local half of a fetch: what this store already has.

One method, because one answer serves both questions the protocol asks of the local side: the oids are the have list, and the names are what makes RefUpdatePlan::old a real old value rather than a guess.

gunnar-server implements this over GitOps::refs — one call, one snapshot — and a test implements it over a Vec.

Required Methods§

Source

fn tips(&self) -> Result<Vec<(String, ObjectId)>>

Every local reference and the object it resolves to, HEAD excluded.

A symbolic reference should be resolved before it gets here; an unborn one should simply be absent. Both are questions RefSnapshot already answers for a caller holding a store.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl LocalRefs for Vec<(String, ObjectId)>

Implementors§