Struct aopt_help::AddCmd2App

source ·
pub struct AddCmd2App<'a, 'b, W: Write> { /* private fields */ }

Implementations§

Examples found in repository?
src/lib.rs (line 257)
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
    pub fn new_cmd<S: Into<Cow<'a, str>>>(
        &mut self,
        block: S,
        name: S,
    ) -> Result<AddCmd2App<'a, '_, W>> {
        let name = name.into();
        let block = block.into();

        self.find_block_mut(block.clone())
            .ok_or_else(|| Error::InvalidBlockName(block.to_string()))?;
        if self.find_cmd(name.clone()).is_some() {
            Err(Error::DuplicatedCommandName(name.to_string()))
        } else {
            Ok(AddCmd2App::new(self, block, name))
        }
    }

Trait Implementations§

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.