pub struct GitCache { /* private fields */ }Implementations§
Source§impl GitCache
impl GitCache
pub fn new(cfg: GitConfig, metrics: Arc<Metrics>) -> Self
Sourcepub async fn ensure_fresh(
&self,
repo: &RepoRef,
want_fetch: bool,
) -> Result<CacheOutcome>
pub async fn ensure_fresh( &self, repo: &RepoRef, want_fetch: bool, ) -> Result<CacheOutcome>
Ensure the mirror exists and (when want_fetch) is fresh. Concurrent
callers for the same repo are serialized; the first does the work, the
rest see it already fresh.
Sourcepub async fn advertise_refs(
&self,
repo: &RepoRef,
git_protocol: Option<&str>,
) -> Result<Bytes>
pub async fn advertise_refs( &self, repo: &RepoRef, git_protocol: Option<&str>, ) -> Result<Bytes>
git upload-pack --advertise-refs, wrapped with the smart-HTTP service
header - i.e. the GET .../info/refs?service=git-upload-pack body.
Sourcepub async fn upload_pack_rpc(
&self,
repo: &RepoRef,
git_protocol: Option<&str>,
body: Bytes,
) -> Result<ReaderStream<ChildStdout>>
pub async fn upload_pack_rpc( &self, repo: &RepoRef, git_protocol: Option<&str>, body: Bytes, ) -> Result<ReaderStream<ChildStdout>>
Stream git upload-pack --stateless-rpc - i.e. the
POST .../git-upload-pack response (the packfile). The request body
(the client’s want/have negotiation) is small and buffered; the response
can be gigabytes, so it is streamed straight from the child’s stdout.
Auto Trait Implementations§
impl !Freeze for GitCache
impl !RefUnwindSafe for GitCache
impl !UnwindSafe for GitCache
impl Send for GitCache
impl Sync for GitCache
impl Unpin for GitCache
impl UnsafeUnpin for GitCache
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