Skip to main content

remote_fs/
lib.rs

1//! Unified async remote file operations over **SMB**, **FTP**, and **SFTP**.
2//!
3//! Backends:
4//! - SMB → [`smb2`](https://crates.io/crates/smb2)
5//! - FTP → [`async-ftp`](https://crates.io/crates/async-ftp)
6//! - SFTP → [`async-ssh2-tokio`](https://crates.io/crates/async-ssh2-tokio) (+ `russh-sftp`)
7//!
8//! # Quick start
9//!
10//! ```no_run
11//! use remote_fs::{Client, FtpConfig, RemoteFileSystem};
12//!
13//! # #[tokio::main]
14//! # async fn main() -> Result<(), remote_fs::Error> {
15//! let cfg = FtpConfig::new("ftp.example.com", "user", "pass");
16//! let mut client = Client::ftp(&cfg).await?;
17//! let entries = client.list("/").await?;
18//! client.write("/hello.txt", b"hello").await?;
19//! client.disconnect().await?;
20//! # Ok(())
21//! # }
22//! ```
23
24mod client;
25mod error;
26mod ftp;
27mod sftp;
28mod smb;
29mod traits;
30mod types;
31
32pub use client::{Client, ClientBuilder};
33pub use error::{Error, Result};
34pub use ftp::FtpClient;
35pub use sftp::SftpClient;
36pub use smb::SmbClient;
37pub use traits::RemoteFileSystem;
38pub use types::{
39    Config, FileEntry, FileMeta, FtpConfig, Protocol, SftpConfig, SmbConfig,
40};