[−][src]Struct getopt::Opt
A single option.
For Opt(x, y)
:
x
is the character representing the option.y
isSome
string, orNone
if no argument was expected.
Example
use getopt::Opt; // args = ["program", "-abc", "foo"]; let optstring = "ab:c"; let mut opts = getopt::Parser::new(&args, optstring); assert_eq!(Opt('a', None), opts.next().transpose()?.unwrap()); assert_eq!(Opt('b', Some("c".to_string())), opts.next().transpose()?.unwrap()); assert_eq!(None, opts.next().transpose()?);
Trait Implementations
impl Debug for Opt
[src]
impl Display for Opt
[src]
impl Eq for Opt
[src]
impl Ord for Opt
[src]
pub fn cmp(&self, other: &Opt) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<Opt> for Opt
[src]
impl PartialOrd<Opt> for Opt
[src]
pub fn partial_cmp(&self, other: &Opt) -> Option<Ordering>
[src]
pub fn lt(&self, other: &Opt) -> bool
[src]
pub fn le(&self, other: &Opt) -> bool
[src]
pub fn gt(&self, other: &Opt) -> bool
[src]
pub fn ge(&self, other: &Opt) -> bool
[src]
impl StructuralEq for Opt
[src]
impl StructuralPartialEq for Opt
[src]
Auto Trait Implementations
impl RefUnwindSafe for Opt
[src]
impl Send for Opt
[src]
impl Sync for Opt
[src]
impl Unpin for Opt
[src]
impl UnwindSafe for Opt
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,