pub struct FtpConnection {
pub stream: BufReader<TcpStream>,
pub options: FtpOptions,
pub host: String,
pub port: u16,
}Fields§
§stream: BufReader<TcpStream>§options: FtpOptions§host: String§port: u16Implementations§
Source§impl FtpConnection
impl FtpConnection
pub async fn connect( host: &str, port: u16, options: Option<FtpOptions>, ) -> Result<Self, String>
pub async fn login(&mut self) -> Result<(), String>
pub async fn cwd(&mut self, path: &str) -> Result<(), String>
pub async fn size(&mut self, filename: &str) -> Result<u64, String>
pub async fn mdtm(&mut self, filename: &str) -> Result<String, String>
pub async fn pasv(&mut self) -> Result<(String, u16), String>
pub async fn epsv(&mut self) -> Result<u16, String>
Sourcepub async fn port_active(&mut self) -> Result<u16, String>
pub async fn port_active(&mut self) -> Result<u16, String>
Enter active mode using PORT command (IPv4) Binds a local socket and sends PORT command with local address
Sourcepub async fn eprt_active(&mut self) -> Result<(String, u16), String>
pub async fn eprt_active(&mut self) -> Result<(String, u16), String>
Enter active mode using EPRT command (IPv6/IPv4) Extended PORT command that supports both IPv4 and IPv6
pub async fn rest(&mut self, offset: u64) -> Result<(), String>
pub async fn retr(&mut self, filename: &str) -> Result<(), String>
pub async fn type_image(&mut self) -> Result<(), String>
pub async fn quit(self) -> Result<(), String>
Sourcepub async fn abor(&mut self) -> Result<(), String>
pub async fn abor(&mut self) -> Result<(), String>
Send ABOR command to abort a transfer in progress
Sourcepub async fn list(&mut self, path: Option<&str>) -> Result<FtpResponse, String>
pub async fn list(&mut self, path: Option<&str>) -> Result<FtpResponse, String>
Send LIST command to get directory listing (detailed format)
Sourcepub async fn nlst(&mut self, path: Option<&str>) -> Result<FtpResponse, String>
pub async fn nlst(&mut self, path: Option<&str>) -> Result<FtpResponse, String>
Send NLST command to get directory listing (names only)
Sourcepub async fn type_ascii(&mut self) -> Result<(), String>
pub async fn type_ascii(&mut self) -> Result<(), String>
Send TYPE A command for ASCII mode transfer
Sourcepub async fn noop(&mut self) -> Result<(), String>
pub async fn noop(&mut self) -> Result<(), String>
Send NOOP command for keep-alive / connection test
Sourcepub fn start_keepalive(&self) -> Option<JoinHandle<()>>
pub fn start_keepalive(&self) -> Option<JoinHandle<()>>
Start keep-alive task for control channel Returns a handle that can be used to stop the keep-alive
pub fn get_data_stream(&mut self) -> &mut BufReader<TcpStream>
pub async fn read_response(&mut self) -> Result<FtpResponse, String>
Auto Trait Implementations§
impl !Freeze for FtpConnection
impl RefUnwindSafe for FtpConnection
impl Send for FtpConnection
impl Sync for FtpConnection
impl Unpin for FtpConnection
impl UnsafeUnpin for FtpConnection
impl UnwindSafe for FtpConnection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more