pub struct LoginCommand {
pub executor: CommandExecutor,
/* private fields */
}Expand description
Command for authenticating with Docker registries
The LoginCommand provides a builder pattern for constructing Docker login commands
with various authentication options including username/password, token-based auth,
and different registry endpoints.
§Examples
use docker_wrapper::LoginCommand;
// Login to Docker Hub
let login = LoginCommand::new("myusername", "mypassword");
// Login to private registry
let login = LoginCommand::new("user", "pass")
.registry("my-registry.com");
// Login with stdin password (more secure)
let login = LoginCommand::new("user", "")
.password_stdin();Fields§
§executor: CommandExecutorCommand executor for running the command
Implementations§
Source§impl LoginCommand
impl LoginCommand
Sourcepub fn password_stdin(self) -> Self
pub fn password_stdin(self) -> Self
Enables reading password from stdin for security
When enabled, the password field is ignored and Docker will prompt for password input via stdin.
§Examples
use docker_wrapper::LoginCommand;
let login = LoginCommand::new("user", "")
.password_stdin();Sourcepub fn executor(self, executor: CommandExecutor) -> Self
pub fn executor(self, executor: CommandExecutor) -> Self
Sourcepub fn get_username(&self) -> &str
pub fn get_username(&self) -> &str
Gets the username
Sourcepub fn get_registry(&self) -> Option<&str>
pub fn get_registry(&self) -> Option<&str>
Gets the registry (if set)
Sourcepub fn is_password_stdin(&self) -> bool
pub fn is_password_stdin(&self) -> bool
Returns true if password will be read from stdin
Sourcepub fn get_executor(&self) -> &CommandExecutor
pub fn get_executor(&self) -> &CommandExecutor
Get a reference to the command executor
Sourcepub fn get_executor_mut(&mut self) -> &mut CommandExecutor
pub fn get_executor_mut(&mut self) -> &mut CommandExecutor
Get a mutable reference to the command executor
Trait Implementations§
Source§impl Clone for LoginCommand
impl Clone for LoginCommand
Source§fn clone(&self) -> LoginCommand
fn clone(&self) -> LoginCommand
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 LoginCommand
impl Debug for LoginCommand
Source§impl Default for LoginCommand
impl Default for LoginCommand
Source§impl Display for LoginCommand
impl Display for LoginCommand
Source§impl DockerCommand for LoginCommand
impl DockerCommand for LoginCommand
Source§type Output = LoginOutput
type Output = LoginOutput
The output type this command produces
Source§fn get_executor(&self) -> &CommandExecutor
fn get_executor(&self) -> &CommandExecutor
Get the command executor for extensibility
Source§fn get_executor_mut(&mut self) -> &mut CommandExecutor
fn get_executor_mut(&mut self) -> &mut CommandExecutor
Get mutable command executor for extensibility
Source§fn build_command_args(&self) -> Vec<String>
fn build_command_args(&self) -> Vec<String>
Build the complete command arguments including subcommands
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the command and return the typed output
Source§fn execute_command<'life0, 'async_trait>(
&'life0 self,
command_args: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn execute_command<'life0, 'async_trait>(
&'life0 self,
command_args: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Helper method to execute the command with proper error handling
Source§fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
Add a raw argument to the command (escape hatch)
Auto Trait Implementations§
impl Freeze for LoginCommand
impl RefUnwindSafe for LoginCommand
impl Send for LoginCommand
impl Sync for LoginCommand
impl Unpin for LoginCommand
impl UnwindSafe for LoginCommand
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.