Skip to main content

Crate unftp_sbe_fs

Crate unftp_sbe_fs 

Source
Expand description

A libunftp StorageBackend that uses a local filesystem, like a traditional FTP server.

Here is an example for using this storage backend

use libunftp::ServerBuilder;
use unftp_sbe_fs::Filesystem;

#[tokio::main]
pub async fn main() {
    let ftp_home = std::env::temp_dir();
    let server = ServerBuilder::new(Box::new(move || Filesystem::new(ftp_home.clone()).unwrap()))
        .greeting("Welcome to my FTP server")
        .passive_ports(50000..=65535)
        .build()
        .unwrap();

    server.listen("127.0.0.1:2121").await;
}

Structsยง

Filesystem
The Filesystem struct is an implementation of the StorageBackend trait that keeps its files inside a specific root directory on local disk.
Meta
Metadata for the storage back-end