pub struct PromisorAdvertisement {
pub remotes: Vec<PromisorInfo>,
}Expand description
The promisor remotes a server advertises with the promisor-remote capability.
Fields§
§remotes: Vec<PromisorInfo>Advertised remotes in advertisement order. Each has a name and a non-empty URL.
Implementations§
Source§impl PromisorAdvertisement
impl PromisorAdvertisement
Sourcepub fn from_server_config(cfg: &ConfigSet) -> Option<Self>
pub fn from_server_config(cfg: &ConfigSet) -> Option<Self>
Build the advertisement a server sends.
Only promisor remotes with a non-empty URL are advertised; the fields listed in
promisor.sendFields are included when set to a non-empty value.
§Parameters
cfg: the served repository’s config.
§Returns
None when promisor.advertise is not true or there is no remote to advertise.
Sourcepub fn parse(value: &str) -> Self
pub fn parse(value: &str) -> Self
Parse the value of a server’s promisor-remote= capability.
Remotes are separated by ; and fields by ,; values are percent-decoded. An entry
without a name or with a missing or empty URL is dropped, and unknown fields are
ignored, as the protocol requires.
§Parameters
value: the text afterpromisor-remote=.
Sourcepub fn to_capability_value(&self) -> String
pub fn to_capability_value(&self) -> String
Serialize as the value of the promisor-remote= capability.
§Returns
name=<n>,url=<u>[,partialCloneFilter=<f>][,token=<t>] per remote, joined with ;.
Trait Implementations§
Source§impl Clone for PromisorAdvertisement
impl Clone for PromisorAdvertisement
Source§impl Debug for PromisorAdvertisement
impl Debug for PromisorAdvertisement
Source§impl Default for PromisorAdvertisement
impl Default for PromisorAdvertisement
impl Eq for PromisorAdvertisement
Source§impl PartialEq for PromisorAdvertisement
impl PartialEq for PromisorAdvertisement
impl StructuralPartialEq for PromisorAdvertisement
Auto Trait Implementations§
impl Freeze for PromisorAdvertisement
impl RefUnwindSafe for PromisorAdvertisement
impl Send for PromisorAdvertisement
impl Sync for PromisorAdvertisement
impl Unpin for PromisorAdvertisement
impl UnsafeUnpin for PromisorAdvertisement
impl UnwindSafe for PromisorAdvertisement
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.