[−][src]Struct rsyn::Client
A client for an rsync server.
The client is built with information about the location of the server and what options to use, and then transfer operations can be invoked.
Clients can be parsed from strings:
let client = rsyn::Client::from_str("rsync.example.com::module") .expect("Parse failed");
Or constructed:
let client = rsyn::Client::local("./src"); let client = rsyn::Client::ssh(Some("user"), "host.example.com", "./src");
Implementations
impl Client
[src]
pub fn local<P: AsRef<Path>>(path: P) -> Client
[src]
Builds a Client
that, when connected, starts an rsync --server
subprocess
on the local machine.
This is primarily useful for testing, or copying files locally.
pub fn ssh(user: Option<&str>, host: &str, path: &str) -> Client
[src]
Builds a Client
that will connect to an rsync server over ssh.
This will run an external SSH process, defaulting to ssh
, controlled
by Options.ssh_command
.
If user
is None, ssh's default username, typically the same as the
local user, has effect.
path
is the path on the remote host.
pub fn mut_options(&mut self) -> &mut Options
[src]
Mutably borrow this client's Options
.
pub fn set_options(&mut self, options: Options) -> &mut Self
[src]
Replace this client's Options
.
pub fn set_recursive(&mut self, recursive: bool) -> &mut Self
[src]
Set the recursive
option.
pub fn set_verbose(&mut self, verbose: u32) -> &mut Self
[src]
Set the verbose
option.
pub fn list_files(&mut self) -> Result<(FileList, ServerStatistics)>
[src]
List files from the remote server.
This implicitly sets the list_only
option.
pub fn from_str(s: &str) -> Result<Self>
[src]
Builds a Client from a path, URL, or SFTP-like path.
let client = rsyn::Client::from_str("rsync.example.com::module") .expect("Parse failed");
Trait Implementations
impl Clone for Client
[src]
impl Debug for Client
[src]
impl Eq for Client
[src]
impl PartialEq<Client> for Client
[src]
impl StructuralEq for Client
[src]
impl StructuralPartialEq for Client
[src]
Auto Trait Implementations
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,