pub struct PromisorHandshake {
pub decision: PromisorDecision,
pub stored: Vec<StoredPromisorField>,
pub resolved_filter: Option<ObjectFilterSpec>,
pub warnings: Vec<PromisorConfigWarning>,
}Expand description
What the promisor-remote exchange decided for one fetch.
Built by the fetch driver when the server advertises promisor remotes and returned in
FetchOutcome::promisor.
Fields§
§decision: PromisorDecisionThe verdict on every advertised remote.
stored: Vec<StoredPromisorField>Fields written into local config (promisor.storeFields).
resolved_filter: Option<ObjectFilterSpec>The filter chosen from the accepted remotes, when the fetch asked for one
automatically (FetchOptions::auto_filter).
warnings: Vec<PromisorConfigWarning>Config values that were ignored, advertised values that were not stored, and advertised filters too complex to use as the automatic filter.
Implementations§
Source§impl PromisorHandshake
impl PromisorHandshake
Sourcepub fn evaluate(
cfg: &ConfigSet,
advertisement: &PromisorAdvertisement,
partial_fetch: bool,
auto_filter: bool,
) -> Self
pub fn evaluate( cfg: &ConfigSet, advertisement: &PromisorAdvertisement, partial_fetch: bool, auto_filter: bool, ) -> Self
Decide the client side of the exchange.
Reads the client’s policy from cfg, decides against its configured promisor remotes,
and declines everything with PromisorRejection::NotPartialFetch unless
partial_fetch: a client that is not doing a partial fetch needs every object from
this server. With auto_filter, also picks the filter for the fetch from the accepted
remotes (PromisorDecision::combined_filter). Writes nothing; see
Self::store_fields.
§Parameters
cfg: the client’s merged config.advertisement: what the server advertised.partial_fetch: whether the fetch is filtered or is from a promisor remote.auto_filter: whether to resolve the filter from the accepted remotes.
Sourcepub fn store_fields(&mut self, git_dir: &Path, cfg: &ConfigSet) -> Result<()>
pub fn store_fields(&mut self, git_dir: &Path, cfg: &ConfigSet) -> Result<()>
Write promisor.storeFields values of the accepted remotes into git_dir’s config
(see store_advertised_fields), recording what was written in Self::stored.
§Parameters
git_dir: the repository being fetched into.cfg: the client’s merged config, loaded before the fetch.
§Errors
Returns Error when the local config file cannot be read or written.
Trait Implementations§
Source§impl Clone for PromisorHandshake
impl Clone for PromisorHandshake
Source§impl Debug for PromisorHandshake
impl Debug for PromisorHandshake
Source§impl Default for PromisorHandshake
impl Default for PromisorHandshake
impl Eq for PromisorHandshake
Source§impl PartialEq for PromisorHandshake
impl PartialEq for PromisorHandshake
impl StructuralPartialEq for PromisorHandshake
Auto Trait Implementations§
impl Freeze for PromisorHandshake
impl RefUnwindSafe for PromisorHandshake
impl Send for PromisorHandshake
impl Sync for PromisorHandshake
impl Unpin for PromisorHandshake
impl UnsafeUnpin for PromisorHandshake
impl UnwindSafe for PromisorHandshake
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.