pub struct Option<'a> { /* private fields */ }
Expand description
§Option
§Examples
use std::borrow::Cow;
use dia_args::docs::{self, Option};
// All these constants are convenient while working with Args.
// And you can also use them for Option.
const OPTION_PORT: &[&str] = &["-p", "--port"];
const OPTION_PORT_VALUES: &[u16] = &[0, 64009];
const OPTION_PORT_DEFAULT: u16 = OPTION_PORT_VALUES[1];
const OPTION_PORT_DOCS: Cow<str> = Cow::Borrowed("Port for server.");
let _option = Option::new(
OPTION_PORT, false,
OPTION_PORT_VALUES,
Some(OPTION_PORT_DEFAULT),
OPTION_PORT_DOCS,
);
// Here you can pass this option to Docs::new(...)
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Option<'a>
impl<'a> RefUnwindSafe for Option<'a>
impl<'a> Send for Option<'a>
impl<'a> Sync for Option<'a>
impl<'a> Unpin for Option<'a>
impl<'a> UnwindSafe for Option<'a>
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