pub struct FtpBuilder { /* private fields */ }Expand description
Builder for FTP control connection messages (commands and replies).
Implementations§
Source§impl FtpBuilder
impl FtpBuilder
pub fn new() -> Self
Sourcepub fn reply(self, code: u16, text: impl Into<String>) -> Self
pub fn reply(self, code: u16, text: impl Into<String>) -> Self
Set the reply code and message text.
Sourcepub fn multiline(self, lines: Vec<String>) -> Self
pub fn multiline(self, lines: Vec<String>) -> Self
Make this a multi-line reply with additional intermediate lines.
Sourcepub fn service_ready(self, text: impl Into<String>) -> Self
pub fn service_ready(self, text: impl Into<String>) -> Self
Build “220 Service ready” reply.
Sourcepub fn user_logged_in(self, text: impl Into<String>) -> Self
pub fn user_logged_in(self, text: impl Into<String>) -> Self
Build “230 User logged in” reply.
Sourcepub fn password_required(self) -> Self
pub fn password_required(self) -> Self
Build “331 Password required” reply.
Sourcepub fn passive_mode(
self,
h1: u8,
h2: u8,
h3: u8,
h4: u8,
p1: u8,
p2: u8,
) -> Self
pub fn passive_mode( self, h1: u8, h2: u8, h3: u8, h4: u8, p1: u8, p2: u8, ) -> Self
Build “227 Entering Passive Mode” reply.
Sourcepub fn extended_passive_mode(self, port: u16) -> Self
pub fn extended_passive_mode(self, port: u16) -> Self
Build “229 Entering Extended Passive Mode” reply.
Sourcepub fn transfer_complete(self) -> Self
pub fn transfer_complete(self) -> Self
Build “226 Transfer complete” reply.
Sourcepub fn file_status_ok(self) -> Self
pub fn file_status_ok(self) -> Self
Build “150 File status okay” reply.
Sourcepub fn file_action_ok(self) -> Self
pub fn file_action_ok(self) -> Self
Build “250 Requested file action OK” reply.
Sourcepub fn pathname_created(self, path: impl Into<String>) -> Self
pub fn pathname_created(self, path: impl Into<String>) -> Self
Build “257 pathname created” reply.
Sourcepub fn service_not_available(self) -> Self
pub fn service_not_available(self) -> Self
Build “421 Service not available” reply.
Sourcepub fn not_logged_in(self) -> Self
pub fn not_logged_in(self) -> Self
Build “530 Not logged in” reply.
Build “550 File unavailable” reply.
Sourcepub fn syntax_error(self, text: impl Into<String>) -> Self
pub fn syntax_error(self, text: impl Into<String>) -> Self
Build “500 Syntax error” reply.
Sourcepub fn feat_reply(self, features: Vec<String>) -> Self
pub fn feat_reply(self, features: Vec<String>) -> Self
Build a FEAT reply (RFC 2389 feature list).
Sourcepub fn command(self, verb: impl Into<String>, args: impl Into<String>) -> Self
pub fn command(self, verb: impl Into<String>, args: impl Into<String>) -> Self
Set a raw command verb and optional args.
Trait Implementations§
Source§impl Clone for FtpBuilder
impl Clone for FtpBuilder
Source§fn clone(&self) -> FtpBuilder
fn clone(&self) -> FtpBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FtpBuilder
impl Debug for FtpBuilder
Auto Trait Implementations§
impl Freeze for FtpBuilder
impl RefUnwindSafe for FtpBuilder
impl Send for FtpBuilder
impl Sync for FtpBuilder
impl Unpin for FtpBuilder
impl UnsafeUnpin for FtpBuilder
impl UnwindSafe for FtpBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more