remote-fs 0.1.2

Unified async file operations over SMB, FTP, and SFTP
Documentation
//! Unified async remote file operations over **SMB**, **FTP**, and **SFTP**.
//!
//! # Features
//!
//! | Feature | Backend |
//! |---------|---------|
//! | `ftp`   | [`async-ftp`](https://crates.io/crates/async-ftp) |
//! | `smb`   | [`smb2`](https://crates.io/crates/smb2) |
//! | `sftp`  | [`async-ssh2-tokio`](https://crates.io/crates/async-ssh2-tokio) |
//! | `full`  | `smb` + `ftp` + `sftp` |
//!
//! ```toml
//! remote-fs = { version = "0.1", features = ["ftp"] }
//! remote-fs = { version = "0.1", features = ["full"] }
//! ```
//!
//! # Quick start
//!
//! ```no_run
//! # #[cfg(feature = "ftp")]
//! # {
//! use remote_fs::{Client, FtpConfig, RemoteFileSystem};
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), remote_fs::Error> {
//! let cfg = FtpConfig::new("ftp.example.com", "user", "pass");
//! let mut client = Client::ftp(&cfg).await?;
//! let entries = client.list("/").await?;
//! client.write("/hello.txt", b"hello").await?;
//! client.disconnect().await?;
//! # Ok(())
//! # }
//! # }
//! # #[cfg(not(feature = "ftp"))]
//! # fn main() {}
//! ```

mod client;
mod error;
mod traits;
mod types;

#[cfg(feature = "ftp")]
mod ftp;
#[cfg(feature = "sftp")]
mod sftp;
#[cfg(feature = "smb")]
mod smb;

pub use client::{Client, ClientBuilder};
pub use error::{Error, Result};
pub use traits::RemoteFileSystem;
pub use types::{Config, FileEntry, FileMeta, Protocol};

#[cfg(feature = "ftp")]
pub use ftp::FtpClient;
#[cfg(feature = "ftp")]
pub use types::FtpConfig;

#[cfg(feature = "sftp")]
pub use sftp::SftpClient;
#[cfg(feature = "sftp")]
pub use types::SftpConfig;

#[cfg(feature = "smb")]
pub use smb::SmbClient;
#[cfg(feature = "smb")]
pub use types::SmbConfig;