pub struct RsyncClient { /* private fields */ }Expand description
The main client struct
Implementations§
Source§impl RsyncClient
impl RsyncClient
Sourcepub async fn connect(url: &Url) -> Result<(RsyncClient, Vec<File>)>
pub async fn connect(url: &Url) -> Result<(RsyncClient, Vec<File>)>
Open a connection to an rsync server and read the initial file list.
The url must have scheme rsync and contain at least one path element (module listing is
not supported).
Sourcepub async fn get(&self, file: &File) -> Result<impl AsyncRead>
pub async fn get(&self, file: &File) -> Result<impl AsyncRead>
Requests the transfer of a File.
The referenced File must have been returned in the same call as self, or an error will be
returned.
There are some worrying remarks in the rsync protocol documentation in openrsync. It is stated that requested files may be silently ommited from transfer, and that files are not necessarily transmited in the order they were requested. Effectively, this means that the only way to detect that a file wasn’t sent is to invoke close, and then to wait for the sender to signal the end of the connection. Without calling close, the returned AsyncRead may remain pending forever.
Sourcepub async fn close(&mut self) -> Result<Stats>
pub async fn close(&mut self) -> Result<Stats>
Finalizes the connection and returns statistics about the transfer (See Stats). All files that have allready been requested will be transferred before the returned future completes. Only one call to this function can succeed per RsyncClient.
Trait Implementations§
Source§impl Clone for RsyncClient
impl Clone for RsyncClient
Source§fn clone(&self) -> RsyncClient
fn clone(&self) -> RsyncClient
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more