pub struct VerbStore { /* private fields */ }
Expand description
Provide access to the verbs:
- the built-in ones
- the user defined ones A user defined verb can replace a built-in. When the user types some keys, we select a verb
- if the input exactly matches a shortcut or the name
- if only one verb name starts with the input
Implementations§
source§impl VerbStore
impl VerbStore
pub fn new(conf: &mut Conf) -> Result<Self, ConfError>
pub fn add_verb( &mut self, invocation_str: Option<&str>, execution: VerbExecution, description: VerbDescription ) -> Result<&mut Verb, ConfError>
sourcepub fn add_from_conf(&mut self, vc: &VerbConf) -> Result<(), ConfError>
pub fn add_from_conf(&mut self, vc: &VerbConf) -> Result<(), ConfError>
Create a verb from its configuration, adding it to its store
pub fn search_sel_info<'v>( &'v self, prefix: &str, sel_info: SelInfo<'_> ) -> PrefixSearchResult<'v, &Verb>
pub fn search_prefix<'v>( &'v self, prefix: &str ) -> PrefixSearchResult<'v, &Verb>
sourcepub fn search_sel_info_unique<'v>(
&'v self,
prefix: &str,
sel_info: SelInfo<'_>
) -> Option<&'v Verb>
pub fn search_sel_info_unique<'v>( &'v self, prefix: &str, sel_info: SelInfo<'_> ) -> Option<&'v Verb>
Return either the only match, or None if there’s not exactly one match
pub fn search<'v>( &'v self, prefix: &str, sel_info: Option<SelInfo<'_>> ) -> PrefixSearchResult<'v, &Verb>
pub fn key_desc_of_internal_stype( &self, internal: Internal, stype: SelectionType ) -> Option<String>
pub fn key_desc_of_internal(&self, internal: Internal) -> Option<String>
pub fn verbs(&self) -> &[Verb]
pub fn verb(&self, id: VerbId) -> &Verb
Auto Trait Implementations§
impl RefUnwindSafe for VerbStore
impl Send for VerbStore
impl Sync for VerbStore
impl Unpin for VerbStore
impl UnwindSafe for VerbStore
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
Mutably borrows from an owned value. Read more