pub struct SmartAdvertisement<'a> { /* private fields */ }Expand description
A validated smart-HTTP advertisement. Empty repositories are valid but have no HEAD. Capabilities and reference names borrow the caller’s response.
Implementations§
Source§impl<'a> SmartAdvertisement<'a>
impl<'a> SmartAdvertisement<'a>
pub fn parse(data: &'a [u8]) -> Result<Self>
pub fn head(&self) -> Result<ObjectId>
Sourcepub fn resolve_reference(&self, name: &str) -> Result<ObjectId>
pub fn resolve_reference(&self, name: &str) -> Result<ObjectId>
Resolve HEAD or a normalized fully qualified ref, including tags.
pub fn object_format(&self) -> Option<ObjectFormat>
pub fn supports_shallow(&self) -> bool
Sourcepub fn supports(&self, capability: &str) -> bool
pub fn supports(&self, capability: &str) -> bool
Test an exact advertised capability token, without accepting prefixes.
Sourcepub fn fetch_options(&self, shallow_depth: Option<u32>) -> FetchOptions
pub fn fetch_options(&self, shallow_depth: Option<u32>) -> FetchOptions
Request only capabilities advertised by this origin. An origin without shallow support falls back to a full fetch within the host’s budgets.
Sourcepub fn validate_want(&self, id: ObjectId) -> Result<()>
pub fn validate_want(&self, id: ObjectId) -> Result<()>
Validate protocol permission to request an ID. Unadvertised IDs require an allow-*-sha1-in-want capability; the server still checks whether the ID is an allowed hidden tip or reachable object under that capability.
pub fn references(&self) -> References<'a> ⓘ
Auto Trait Implementations§
impl<'a> Freeze for SmartAdvertisement<'a>
impl<'a> RefUnwindSafe for SmartAdvertisement<'a>
impl<'a> Send for SmartAdvertisement<'a>
impl<'a> Sync for SmartAdvertisement<'a>
impl<'a> Unpin for SmartAdvertisement<'a>
impl<'a> UnsafeUnpin for SmartAdvertisement<'a>
impl<'a> UnwindSafe for SmartAdvertisement<'a>
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
Mutably borrows from an owned value. Read more