pub struct Transfer { /* private fields */ }Expand description
Concurrent transfer queue. One Transfer is bound to one LFS endpoint
(the api client) and one local store; create more if you need more.
Implementations§
Source§impl Transfer
impl Transfer
Sourcepub fn new(api: ApiClient, store: Store, config: TransferConfig) -> Self
pub fn new(api: ApiClient, store: Store, config: TransferConfig) -> Self
Build a transfer queue. The reqwest::Client used for the action-URL
transfers is created fresh; if you need to share a connection pool,
use with_http_client.
pub fn with_http_client( api: ApiClient, store: Store, config: TransferConfig, http: Client, ) -> Self
Sourcepub async fn download(
&self,
objects: Vec<ObjectSpec>,
ref: Option<Ref>,
events: Option<UnboundedSender<Event>>,
) -> Result<Report, TransferError>
pub async fn download( &self, objects: Vec<ObjectSpec>, ref: Option<Ref>, events: Option<UnboundedSender<Event>>, ) -> Result<Report, TransferError>
Download the given objects into the local store. Each object is
hash-verified by the store before being committed; corrupt downloads
are surfaced in Report::failed.
Sourcepub async fn upload(
&self,
objects: Vec<ObjectSpec>,
ref: Option<Ref>,
events: Option<UnboundedSender<Event>>,
) -> Result<Report, TransferError>
pub async fn upload( &self, objects: Vec<ObjectSpec>, ref: Option<Ref>, events: Option<UnboundedSender<Event>>, ) -> Result<Report, TransferError>
Upload the given objects from the local store. Objects the server
already has are reported in Report::succeeded without any byte
transfer.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Transfer
impl !RefUnwindSafe for Transfer
impl Send for Transfer
impl Sync for Transfer
impl Unpin for Transfer
impl UnsafeUnpin for Transfer
impl !UnwindSafe for Transfer
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