roopes_core/patterns/command/
mod.rs

1//!
2#![cfg_attr(feature = "doc-images",
3  cfg_attr(
4    all(),
5    doc = ::embed_doc_image::embed_image!(
6        "command-diagram",
7        "src/patterns/command/command.svg"
8)))]
9#![cfg_attr(
10    not(feature = "doc-images"),
11    doc = "**Doc images not enabled**. Compile with feature `doc-images` and \
12           Rust version >= 1.54 to enable."
13)]
14//! Contains types which encapsulate a repeatedly
15//! callable block of code.
16//!
17//! ![command diagram][command-diagram]
18
19pub mod hashable;
20pub mod heap;
21
22pub use hashable::Hashable;
23pub use heap::Heap;
24
25/// Encapsulates a repeatedly callable block of
26/// code.
27pub trait Command
28{
29    /// Calls the encapsulated block of code.
30    fn execute(&self);
31}
32
33/// Exposes the [`Command`] type at the library
34/// level.
35pub mod prelude
36{
37    pub use super::Command;
38}