Skip to main content

AddArgs

Struct AddArgs 

Source
pub struct AddArgs {
Show 15 fields pub name: Option<String>, pub host: Option<String>, pub port: Option<u16>, pub socket: Option<PathBuf>, pub user: Option<String>, pub password_stdin: bool, pub pin_database: Option<bool>, pub auth: Option<String>, pub client_cert: Option<PathBuf>, pub client_key: Option<PathBuf>, pub ca: Option<PathBuf>, pub require_tls: Option<bool>, pub session_setup: Vec<String>, pub read_only_profile: Option<bool>, pub check: bool,
}
Expand description

Fields accepted when creating a profile.

The secret never travels as a flag value, because a flag value is visible in the process list of the whole machine.

Fields§

§name: Option<String>

Profile name.

Optional to the argument layer and required to the command, for the reason given on NameArgs.

§host: Option<String>

Server host.

§port: Option<u16>

Server port.

§socket: Option<PathBuf>

Local socket path, preferred over the network when present.

Also spelled --pipe, which is the name the manual publishes for the same thing on the local channel Windows offers. The requirement number is deliberately not written here: a number in a comment counts as a citation to the coverage walk, and that requirement is still waiting on a host this suite does not have. Naming it would discharge it.

One field carries both spellings, deliberately: the driver has a single setting for it, documented as “path to unix socket (or named pipe on Windows)”, so two fields would be two names for one destination and the caller could set one while the work read the other. That is precisely how --db and --database came to lose a parameter in silence, and an alias cannot do it.

§user: Option<String>

User the credential belongs to.

§password_stdin: bool

Read the secret from the standard input.

§pin_database: Option<bool>

Fix the database, so the profile stops taking a database parameter.

The database itself is named by the global --database, which the manual publishes for this command. A second local flag for the same idea used to sit here and it silently won: the global absorbed the value the caller wrote and the local field it filled was a different one, so conn add p --database loja stored no database at all and still succeeded.

Takes an optional value, like the two truth values below it. Creating a profile has no third state to carry — there is nothing stored yet to leave alone — so --pin-database false and leaving it out mean the same thing here. It accepts the value anyway, because the alternative was measured and is worse: on this one command --require-tls true was accepted while --pin-database true ended in 2 with unexpected argument 'true', a message that names the value rather than the flag and leaves the caller to guess which of three siblings takes one. The spelling conn edit publishes has to work here too, or the caller learns a form that breaks when they move it one command sideways.

§auth: Option<String>

Declared authentication method.

§client_cert: Option<PathBuf>

Client certificate presented to the server.

§client_key: Option<PathBuf>

Key matching the client certificate.

§ca: Option<PathBuf>

Authority used to verify the server certificate.

§require_tls: Option<bool>

Refuse to open unless the channel is encrypted.

Three states, because two cannot carry the answer. Written bare it demands encryption, written --require-tls false it states this destination does not, and left out it says nothing and lets the stored conn.require_tls decide. A bare truth value here would make the stored key unbeatable, which is the precedence the product publishes inverted.

§session_setup: Vec<String>

Session adjustments applied when opening.

§read_only_profile: Option<bool>

Refuse any change through this profile.

Takes an optional value for the reason given on --pin-database above: creating a profile has no third state, but the spelling has to match the one conn edit publishes.

§check: bool

Confirm the connection right away.

Trait Implementations§

Source§

impl Args for AddArgs

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Clone for AddArgs

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AddArgs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for AddArgs

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more