Trait Glossary

Source
pub trait Glossary: Debug {
    // Required method
    fn is_declaration_utility(&self, name: &str) -> Option<bool>;
}
Expand description

Interface used by the parser to tell if a command name is a declaration utility

The parser uses this trait to determine whether a command name is a declaration utility. See the module-level documentation for details.

Required Methods§

Source

fn is_declaration_utility(&self, name: &str) -> Option<bool>

Returns whether the given command name is a declaration utility.

If the command name is a declaration utility, this method should return Some(true). If the command name is not a declaration utility, this method should return Some(false). If the return value is None, this method is called again with the next command word in the simple command being parsed, effectively delegating the decision to the next command word.

To meet the POSIX standard, the method should return Some(true) for the command names export and readonly, and None for the command name command.

Implementations on Foreign Types§

Source§

impl<T: Glossary> Glossary for &T

Source§

impl<T: Glossary> Glossary for &mut T

Source§

impl<T: Glossary> Glossary for RefCell<T>

Allows a glossary to be wrapped in a RefCell.

This implementation’s methods immutably borrow the inner glossary. If the inner glossary is mutably borrowed at the same time, it panics.

Implementors§