1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
#![crate_name = "remotefs_ftp"]
#![crate_type = "lib"]
//! # remotefs-ftp
//!
//! remotefs-ftp is a client implementation for [remotefs](https://github.com/veeso/remotefs-rs), providing support for the FTP/FTPS protocols.
//!
//! ## Get started
//!
//! First of all you need to add **remotefs** and the client to your project dependencies:
//!
//! ```toml
//! remotefs = "^0.2.0"
//! remotefs-ftp = "^0.1.3"
//! ```
//!
//! these features are supported:
//!
//! - `find`: enable `find()` method for RemoteFs. (*enabled by default*)
//! - `secure`: enable FTPS
//! - `no-log`: disable logging. By default, this library will log via the `log` crate.
//!
//!
//! ### FTP client
//!
//! ```rust,ignore
//! use remotefs::RemoteFs;
//! use remotefs::client::ftp::FtpFs;
//! use std::path::Path;
//!
//! let mut client = FtpFs::new("127.0.0.1", 21)
//! .username("test")
//! .password("password");
//! // connect
//! assert!(client.connect().is_ok());
//! // get working directory
//! println!("Wrkdir: {}", client.pwd().ok().unwrap().display());
//! // change working directory
//! assert!(client.change_dir(Path::new("/tmp")).is_ok());
//! // disconnect
//! assert!(client.disconnect().is_ok());
//! ```
//!
#![doc(html_playground_url = "https://play.rust-lang.org")]
// -- crates
#[macro_use]
extern crate log;
pub mod client;
pub use client::FtpFs;
// -- utils
pub(crate) mod utils;
// -- mock
#[cfg(test)]
pub(crate) mod mock;