pub struct FtpsClient { /* private fields */ }Expand description
A one-shot FTPS client (connect → act → quit per call).
Implementations§
Source§impl FtpsClient
impl FtpsClient
pub fn new(target: ResolvedTarget) -> Self
Sourcepub fn list(&self, dir: &str) -> Result<Vec<String>, FtpError>
pub fn list(&self, dir: &str) -> Result<Vec<String>, FtpError>
List file names in dir (FTP NLST).
Sourcepub fn list_entries(&self, dir: &str) -> Result<Vec<FileEntry>, FtpError>
pub fn list_entries(&self, dir: &str) -> Result<Vec<FileEntry>, FtpError>
List dir with directory/size info (FTP LIST, parsed). Unparseable
lines (e.g. a total N header) are skipped.
Sourcepub fn upload(&self, local: &Path, remote_path: &str) -> Result<u64, FtpError>
pub fn upload(&self, local: &Path, remote_path: &str) -> Result<u64, FtpError>
Upload a local file to remote_path on the printer; returns bytes sent.
Sourcepub fn download(&self, remote_path: &str, local: &Path) -> Result<u64, FtpError>
pub fn download(&self, remote_path: &str, local: &Path) -> Result<u64, FtpError>
Download remote_path from the printer to local; returns bytes written.
Streams (FTP RETR) so large files (e.g. timelapse videos) aren’t held
in memory. Writes to a sibling temp file and atomically renames on
success, so a failed or partial transfer never clobbers an existing
destination.
Auto Trait Implementations§
impl Freeze for FtpsClient
impl RefUnwindSafe for FtpsClient
impl Send for FtpsClient
impl Sync for FtpsClient
impl Unpin for FtpsClient
impl UnsafeUnpin for FtpsClient
impl UnwindSafe for FtpsClient
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