Struct structopt_flags::HostV6Param
source · pub struct HostV6Param {
pub host_addr: Ipv6Addr,
}Expand description
This struct provides the --host and -H cli option to get an IPv6 address
No default is provided and the parameter is mandatory This option is not global
ⓘ
extern crate structopt_flags;
#[macro_use]
extern crate structopt;
use std::net::Ipv6Addr;
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
#[structopt(name = "ipv6_param", about = "An example using the HostV6Param option")]
struct Opt {
#[structopt(flatten)]
host_ip: structopt_flags::HostV6Param,
}
fn main() {
let opt = Opt::from_args();
let ipv6 = opt.host_ip.host_addr;
}Fields
host_addr: Ipv6AddrSet the host IP (Ipv6 only)
Trait Implementations
sourceimpl Clone for HostV6Param
impl Clone for HostV6Param
sourcefn clone(&self) -> HostV6Param
fn clone(&self) -> HostV6Param
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl Debug for HostV6Param
impl Debug for HostV6Param
sourceimpl StructOpt for HostV6Param
impl StructOpt for HostV6Param
sourcefn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
Creates the struct from
clap::ArgMatches. It cannot fail
with a parameter generated by clap by construction. Read moresourcefn from_args() -> Selfwhere
Self: Sized,
fn from_args() -> Selfwhere
Self: Sized,
Gets the struct from the command line arguments. Print the
error message and quit the program in case of failure. Read more
sourcefn from_iter<I>(iter: I) -> Selfwhere
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + Clone,
fn from_iter<I>(iter: I) -> Selfwhere
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 moresourcefn from_iter_safe<I>(iter: I) -> Result<Self, Error>where
Self: Sized,
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString> + Clone,
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 moreAuto Trait Implementations
impl RefUnwindSafe for HostV6Param
impl Send for HostV6Param
impl Sync for HostV6Param
impl Unpin for HostV6Param
impl UnwindSafe for HostV6Param
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more