Struct aopt_help::AppHelp

source ·
pub struct AppHelp<'a, W> { /* private fields */ }

Implementations§

source§

impl<'a, W: Write> AppHelp<'a, W>

source

pub fn new<S: Into<Cow<'a, str>>>( name: S, head: S, foot: S, style: Style, writer: W, max_width: usize, usage_new_line: usize ) -> Self

source

pub fn with_global<S: Into<Cow<'a, str>>>( self, name: S, head: S, foot: S ) -> Self

source

pub fn foot(&self) -> Cow<'a, str>

source

pub fn head(&self) -> Cow<'a, str>

source

pub fn name(&self) -> Cow<'a, str>

source

pub fn style(&self) -> &Style

source

pub fn wrap_max_width(&self) -> usize

source

pub fn usage_new_line(&self) -> usize

source

pub fn global(&self) -> &Command<'a>

source

pub fn global_mut(&mut self) -> &mut Command<'a>

source

pub fn block(&self) -> &[Block<'a, Cow<'a, str>>]

source

pub fn block_mut(&mut self) -> &mut [Block<'a, Cow<'a, str>>]

source

pub fn has_cmd(&self) -> bool

If the app has command except global one.

source

pub fn has_pos(&self) -> bool

If the app has position args in any command.

source

pub fn find_cmd<S: Into<Cow<'a, str>>>(&self, cmd: S) -> Option<&Command<'a>>

source

pub fn find_cmd_mut<S: Into<Cow<'a, str>>>( &mut self, cmd: S ) -> Option<&mut Command<'a>>

source

pub fn find_block<S: Into<Cow<'a, str>>>( &self, block: S ) -> Option<&Block<'a, Cow<'a, str>>>

source

pub fn find_block_mut<S: Into<Cow<'a, str>>>( &mut self, block: S ) -> Option<&mut Block<'a, Cow<'a, str>>>

source

pub fn with_name<S: Into<Cow<'a, str>>>(self, name: S) -> Self

source

pub fn with_head<S: Into<Cow<'a, str>>>(self, head: S) -> Self

source

pub fn with_foot<S: Into<Cow<'a, str>>>(self, foot: S) -> Self

source

pub fn with_style(self, style: Style) -> Self

source

pub fn with_writer(self, writer: W) -> Self

source

pub fn set_name<S: Into<Cow<'a, str>>>(&mut self, name: S) -> &mut Self

source

pub fn set_head<S: Into<Cow<'a, str>>>(&mut self, head: S) -> &mut Self

source

pub fn set_foot<S: Into<Cow<'a, str>>>(&mut self, foot: S) -> &mut Self

source

pub fn set_style(&mut self, style: Style) -> &mut Self

source

pub fn set_write(&mut self, writer: W) -> &mut Self

source

pub fn add_block(&mut self, block: Block<'a, Cow<'a, str>>) -> Result<&mut Self>

source

pub fn add_cmd<S: Into<Cow<'a, str>>>( &mut self, block: S, cmd: Command<'a> ) -> Result<&mut Self>

source

pub fn new_block<S: Into<Cow<'a, str>>>( &mut self, name: S ) -> Result<AddBlock2App<'a, '_>>

source

pub fn new_cmd<S: Into<Cow<'a, str>>>( &mut self, block: S, name: S ) -> Result<AddCmd2App<'a, '_, W>>

source

pub fn display(&mut self, show_global: bool) -> Result<()>

source

pub fn display_with<P>(&mut self, policy: P) -> Result<()>where P: HelpPolicy<'a, Self>,

source

pub fn display_cmd<S>(&mut self, cmd: S) -> Result<()>where S: Into<Cow<'a, str>>,

source

pub fn display_cmd_with<S, P>(&mut self, cmd: S, policy: P) -> Result<()>where P: HelpPolicy<'a, Command<'a>>, S: Into<Cow<'a, str>>,

Trait Implementations§

source§

impl<'a, W: Clone> Clone for AppHelp<'a, W>

source§

fn clone(&self) -> AppHelp<'a, W>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, W: Debug> Debug for AppHelp<'a, W>

source§

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

Formats the value using the given formatter. Read more
source§

impl<'a> Default for AppHelp<'a, Stdout>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a, W: Write> HelpPolicy<'a, AppHelp<'a, W>> for DefaultAppPolicy<'a, AppHelp<'a, W>>

source§

fn format(&self, app: &AppHelp<'a, W>) -> Option<Cow<'a, str>>

Auto Trait Implementations§

§

impl<'a, W> RefUnwindSafe for AppHelp<'a, W>where W: RefUnwindSafe,

§

impl<'a, W> Send for AppHelp<'a, W>where W: Send,

§

impl<'a, W> Sync for AppHelp<'a, W>where W: Sync,

§

impl<'a, W> Unpin for AppHelp<'a, W>where W: Unpin,

§

impl<'a, W> UnwindSafe for AppHelp<'a, W>where W: UnwindSafe,

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,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.
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.
source§

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

Performs the conversion.