Struct Manual

Source
pub struct Manual { /* private fields */ }
Expand description

The main man page struct.

Implementations§

Source§

impl Manual

Source

pub fn new(name: &str) -> Self

Create a new instance.

Source

pub fn about<S: Into<String>>(self, about: S) -> Self

Add a short description.

Source

pub fn description<S: Into<String>>(self, description: S) -> Self

Add a long description.

Source

pub fn author(self, author: Author) -> Self

Add an author.

Source

pub fn env(self, env: Env) -> Self

Add an environment variable.

Source

pub fn flag(self, flag: Flag) -> Self

Add an flag.

Source

pub fn option(self, opt: Opt) -> Self

Add an option.

Source

pub fn custom(self, custom_section: Section) -> Self

Add a custom section

Source

pub fn example(self, example: Example) -> Self

Add an examples section

Source

pub fn arg(self, arg: Arg) -> Self

Add a positional argument. The items are displayed in the order they’re pushed.

Source

pub fn custom_synopsis_expansion<S: Into<String>>(self, expansion: S) -> Self

Source

pub fn render(self) -> String

Render to a string.

Trait Implementations§

Source§

impl Debug for Manual

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Manual

§

impl !RefUnwindSafe for Manual

§

impl !Send for Manual

§

impl !Sync for Manual

§

impl Unpin for Manual

§

impl !UnwindSafe for Manual

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, 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.