Skip to main content

MenuLaws

Trait MenuLaws 

Source
pub trait MenuLaws<This>{
    // Required methods
    fn menu_laws(&mut self) -> Result<()>;
    fn law_space(&self, id: This::Id) -> Result<Option<SpaceAction>>;
}
Expand description

Authors the menu-availability laws.

Required Methods§

Source

fn menu_laws(&mut self) -> Result<()>

Checks that availability is derived from page, selection, and queue observations.

The laws checked are:

  1. an empty collection enables only the actions that still have meaning;
  2. a selected ready entry enables Space, Remove, and activation;
  3. cursor movement is enabled exactly when the page holds another value to move to;
  4. activation on the add-sources page is enabled exactly when the draft names a source;
  5. a disabled action denotes no operation, so applying it changes nothing observable.
§Errors

Returns the first violated law.

Source

fn law_space(&self, id: This::Id) -> Result<Option<SpaceAction>>

Observes one entry’s Space meaning by stable identity.

§Errors

Returns a violation when the collection holds no such identity.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§