pub trait MenuLaws<This>where
This: NavigationStateAlg + QueueCatalogAlg + QueueAppendAlg + QueuePauseAlg + QueueDuplicateAlg + TransferStateAlg + SourceMetadataAlg + DetailSelectionAlg + DraftStateAlg + OutputDraftAlg + InputDraftAlg + TextEditorStateAlg + ManagerStatusAlg + SourceRequestAlg + SubmissionAlg + MediaOptionsAlg + OutputChoiceAlg,
This::Entry: QueueEntryAlg + RequestOptionsAlg,
This::Id: Copy + Eq + Debug,{
// 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§
Checks that availability is derived from page, selection, and queue observations.
The laws checked are:
- an empty collection enables only the actions that still have meaning;
- a selected ready entry enables Space, Remove, and activation;
- cursor movement is enabled exactly when the page holds another value to move to;
- activation on the add-sources page is enabled exactly when the draft names a source;
- a disabled action denotes no operation, so applying it changes nothing observable.
§Errors
Returns the first violated law.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<This> MenuLaws<This> for Thiswhere
This: NavigationStateAlg + QueueCatalogAlg + QueueAppendAlg + QueuePauseAlg + QueueDuplicateAlg + TransferStateAlg + SourceMetadataAlg + DetailSelectionAlg + DraftStateAlg + OutputDraftAlg + InputDraftAlg + TextEditorStateAlg + ManagerStatusAlg + SourceRequestAlg + SubmissionAlg + MediaOptionsAlg + OutputChoiceAlg,
This::Entry: QueueEntryAlg + RequestOptionsAlg,
This::Id: Copy + Eq + Debug,
Authors the menu-availability laws.