pub struct Help { /* private fields */ }Expand description
Holds help text blocks and help options blocks.
And this struct creates a HelpIter instance which outputs a help text line by line.
Implementations§
Source§impl Help
impl Help
Sourcepub fn with_margins(margin_left: usize, margin_right: usize) -> Self
pub fn with_margins(margin_left: usize, margin_right: usize) -> Self
Constructs an Help instance with left and right margins.
Sourcepub fn add_text(&mut self, text: String)
pub fn add_text(&mut self, text: String)
Adds a text for a help text block to this help instance.
The indent width of this help text block is set to auto indentation. The margins of a help text generated by this instance equals them which specified at a constructor.
Sourcepub fn add_text_with_indent(&mut self, text: String, indent: usize)
pub fn add_text_with_indent(&mut self, text: String, indent: usize)
Adds a text and an indent width for a help text block to this help instance.
The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of a help text generated by this instance equals them which specified at a constructor.
Sourcepub fn add_text_with_margins(
&mut self,
text: String,
margin_left: usize,
margin_right: usize,
)
pub fn add_text_with_margins( &mut self, text: String, margin_left: usize, margin_right: usize, )
Adds a text and margins for a help text block to this help instance.
The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor. The indent width of this help text block is set to auto indentation.
Sourcepub fn add_text_with_indent_and_margins(
&mut self,
text: String,
indent: usize,
margin_left: usize,
margin_right: usize,
)
pub fn add_text_with_indent_and_margins( &mut self, text: String, indent: usize, margin_left: usize, margin_right: usize, )
Adds a text and an indent width and margins for a help text block to this help instance.
The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor.
Sourcepub fn add_texts(&mut self, texts: Vec<String>)
pub fn add_texts(&mut self, texts: Vec<String>)
Adds texts for a help text block to this help instance.
The indent width of this help text block is set to auto indentation. The margins of a help text generated by this instance equals them which specified at a constructor.
Sourcepub fn add_texts_with_indent(&mut self, texts: Vec<String>, indent: usize)
pub fn add_texts_with_indent(&mut self, texts: Vec<String>, indent: usize)
Adds texts and an indent width for a help text block to this help instance.
The indent width is the number of spaces inserted at the beginning of each line from the
second line.
The margins of a help text generated by this instance equals them which specified at the
new function.
Sourcepub fn add_texts_with_margins(
&mut self,
texts: Vec<String>,
margin_left: usize,
margin_right: usize,
)
pub fn add_texts_with_margins( &mut self, texts: Vec<String>, margin_left: usize, margin_right: usize, )
Adds texts and an indent width and margins for a help text block to this help instance.
The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor. The indent width of this help text block is set to auto indentation.
Sourcepub fn add_texts_with_indent_and_margins(
&mut self,
texts: Vec<String>,
indent: usize,
margin_left: usize,
margin_right: usize,
)
pub fn add_texts_with_indent_and_margins( &mut self, texts: Vec<String>, indent: usize, margin_left: usize, margin_right: usize, )
Adds texts and an indent width and margins for a help text block to this help instance.
The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor.
Sourcepub fn add_opts(&mut self, cfgs: &[OptCfg])
pub fn add_opts(&mut self, cfgs: &[OptCfg])
Adds OptCfg(s) for a help option block to this help instance.
The indent width of this help text block is set to auto indentation. The margins of a help text generated by this instance equals them which specified at a constructor.
Sourcepub fn add_opts_with_indent(&mut self, cfgs: &[OptCfg], indent: usize)
pub fn add_opts_with_indent(&mut self, cfgs: &[OptCfg], indent: usize)
Adds OptCfg(s) and an indent width for a help option block to this help instance.
The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of a help text generated by this instance equals them which specified at a constructor.
Sourcepub fn add_opts_with_margins(
&mut self,
cfgs: &[OptCfg],
margin_left: usize,
margin_right: usize,
)
pub fn add_opts_with_margins( &mut self, cfgs: &[OptCfg], margin_left: usize, margin_right: usize, )
Adds OptCfg(s) and an indent width and margins for a help option block to this help instance.
The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor. The indent width of this help text block is set to auto indentation.
Sourcepub fn add_opts_with_indent_and_margins(
&mut self,
cfgs: &[OptCfg],
indent: usize,
margin_left: usize,
margin_right: usize,
)
pub fn add_opts_with_indent_and_margins( &mut self, cfgs: &[OptCfg], indent: usize, margin_left: usize, margin_right: usize, )
Adds OptCfg(s) and an indent width and margins for a help option block to this help instance.
The indent width is the number of spaces inserted at the beginning of each line from the second line. The margins of this help text block generated by this instance equals the sum of them specified as parameters of this method and them which specified at a constructor.
Auto Trait Implementations§
impl Freeze for Help
impl RefUnwindSafe for Help
impl Send for Help
impl Sync for Help
impl Unpin for Help
impl UnwindSafe for Help
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more