pub struct Lfs { /* private fields */ }Implementations§
Source§impl Lfs
impl Lfs
pub fn new(cfg: LfsConfig, index: Option<Arc<CacheIndex>>) -> Self
Sourcepub async fn batch(
&self,
repo: &str,
body: &[u8],
advertise_base: &str,
) -> Result<Vec<u8>>
pub async fn batch( &self, repo: &str, body: &[u8], advertise_base: &str, ) -> Result<Vec<u8>>
Proxy a client batch request to upstream and rewrite the download hrefs so the
objects are fetched back through this proxy (and thus cached). advertise_base
is the proxy’s own scheme://host as the client reached it. Returns the
rewritten batch JSON.
Sourcepub async fn ensure_object(
&self,
repo: &str,
oid: &str,
size: Option<u64>,
) -> Result<(PathBuf, Outcome)>
pub async fn ensure_object( &self, repo: &str, oid: &str, size: Option<u64>, ) -> Result<(PathBuf, Outcome)>
Ensure the object identified by oid is on disk and return its path plus
whether it was a cache hit. On a miss size is required (the upstream batch
API needs it); it is not needed for a hit.
Auto Trait Implementations§
impl !Freeze for Lfs
impl !RefUnwindSafe for Lfs
impl !UnwindSafe for Lfs
impl Send for Lfs
impl Sync for Lfs
impl Unpin for Lfs
impl UnsafeUnpin for Lfs
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