Skip to main content

Module builder

Module builder 

Source
Expand description

FTP packet builder.

Provides a fluent API for constructing FTP command and reply payloads.

§Examples

use stackforge_core::layer::ftp::builder::FtpBuilder;

// Build a USER command
let pkt = FtpBuilder::new().user("anonymous").build();
assert_eq!(pkt, b"USER anonymous\r\n");

// Build a 220 service-ready reply
let pkt = FtpBuilder::new().service_ready("FTP Server ready").build();
assert_eq!(pkt, b"220 FTP Server ready\r\n");

Structs§

FtpBuilder
Builder for FTP control connection messages (commands and replies).