Struct Options

Source
pub struct Options {
    pub url: Option<String>,
    pub clipboard: bool,
    pub host: Option<String>,
    pub port: u16,
    pub scheme: String,
    pub path: String,
    pub query: Option<String>,
    pub fragment: Option<String>,
    pub domain: Option<String>,
    pub cafile: Option<PathBuf>,
    pub run: bool,
}
Expand description

Options contains the CLI available options offered to the binary tool.

This struct maps all the options that are available to the CLI user. of the binary enqueue-email.

Fields§

§url: Option<String>

The URL to bookmark and enqueue. This excludes scheme, host, port and domain. This option has the priority over the Clipboard.

§clipboard: bool

Use the URL currently on the top of the Clipboard. This option disables all the other defined options.

§host: Option<String>

The host to connect to.

§port: u16

The port to connect to.

§scheme: String

The scheme protocol of the URI.

§path: String

The path component in the URI. This follows the definitions of RFC2396 and RFC3986 (https://en.wikipedia.org/wiki/Uniform_Resource_Identifier).

§query: Option<String>

An optional query component preceded by a question mark (?), containing a query string of non-hierarchical data.

§fragment: Option<String>

An optional fragment component preceded by a hash (#).

§domain: Option<String>

The domain to connect to. This may be different from the host!

§cafile: Option<PathBuf>

A file with a certificate authority chain, allows to connect to certificate authories not included in the default set.

§run: bool

Run msmt-queue and flush all mail currently in queue. This wraps the command ‘msmtp-queue -r’.

Trait Implementations§

Source§

impl Debug for Options

Source§

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

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

impl StructOpt for Options

Source§

fn clap<'a, 'b>() -> App<'a, 'b>

Returns clap::App corresponding to the struct.
Source§

fn from_clap(matches: &ArgMatches<'_>) -> Self

Builds the struct from clap::ArgMatches. It’s guaranteed to succeed if matches originates from an App generated by StructOpt::clap called on the same type, otherwise it must panic.
Source§

fn from_args() -> Self
where Self: Sized,

Builds the struct from the command line arguments (std::env::args_os). Calls clap::Error::exit on failure, printing the error message and aborting the program.
Source§

fn from_args_safe() -> Result<Self, Error>
where Self: Sized,

Builds the struct from the command line arguments (std::env::args_os). Unlike StructOpt::from_args, returns clap::Error on failure instead of aborting the program, so calling .exit is up to you.
Source§

fn from_iter<I>(iter: I) -> Self
where Self: Sized, I: IntoIterator, <I as IntoIterator>::Item: Into<OsString> + Clone,

Gets the struct from any iterator such as a Vec of your making. Print the error message and quit the program in case of failure. Read more
Source§

fn from_iter_safe<I>(iter: I) -> Result<Self, Error>
where Self: Sized, I: IntoIterator, <I as IntoIterator>::Item: Into<OsString> + Clone,

Gets the struct from any iterator such as a Vec of your making. Read more
Source§

impl TryFrom<&Options> for Parts

Source§

type Error = Box<dyn Error>

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

fn try_from(options: &Options) -> Result<Self, Self::Error>

Performs the conversion.

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<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
Source§

impl<T> ErasedDestructor for T
where T: 'static,