[][src]Struct arrsync::RsyncClient

pub struct RsyncClient { /* fields omitted */ }

The main client struct

Implementations

impl RsyncClient[src]

pub async fn connect<'_>(url: &'_ Url) -> Result<(RsyncClient, Vec<File>)>[src]

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).

pub async fn get<'_, '_>(&'_ self, file: &'_ File) -> Result<impl AsyncRead>[src]

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.

pub async fn close<'_>(&'_ mut self) -> Result<Stats>[src]

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

impl Clone for RsyncClient[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.