Struct argwerk::HelpFormat

source ·
pub struct HelpFormat<'a> { /* private fields */ }
Expand description

A wrapper to format the help message with custom parameters.

Constructed through Help::format.

Implementations§

source§

impl HelpFormat<'_>

source

pub fn width(self, width: usize) -> Self

Configure the width to use for help text.

source

pub fn padding(self, padding: usize) -> Self

Configure the padding to use when formatting help.

This determines the indentation of options and the distances between options and help text.

source

pub fn max_usage(self, max_usage: usize) -> Self

Configure the max usage width to use when formatting help.

This determines how wide a usage help is allowed to be before it forces the associated documentation to flow to the next line.

Usage help is the --file, -f <path> part of each switch and argument.

Trait Implementations§

source§

impl<'a> Display for HelpFormat<'a>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for HelpFormat<'a>

§

impl<'a> Send for HelpFormat<'a>

§

impl<'a> Sync for HelpFormat<'a>

§

impl<'a> Unpin for HelpFormat<'a>

§

impl<'a> UnwindSafe for HelpFormat<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.