pub struct StatusDef {
pub min: u16,
pub max: u16,
pub items: Vec<StatusItem>,
}Expand description
Status line definition - defines which items are visible for a command set range
Matches Borland: TStatusDef
In Borland, TStatusDef is a linked list node with:
min,max: command range for which this def is activeitems: pointer to first item in linked listnext: pointer to next status def
In Rust, we use Vec for type safety and provide convenient builders.
Fields§
§min: u16Minimum command ID for which this definition is active
max: u16Maximum command ID for which this definition is active
items: Vec<StatusItem>Status items to display
Implementations§
Source§impl StatusDef
impl StatusDef
Sourcepub fn default_range(items: Vec<StatusItem>) -> Self
pub fn default_range(items: Vec<StatusItem>) -> Self
Create a status definition for all command ranges (default)
Matches Borland: TStatusDef(0, 0xFFFF, items)
Sourcepub fn applies_to(&self, command_set: u16) -> bool
pub fn applies_to(&self, command_set: u16) -> bool
Check if this definition applies to the given command set
In Borland, the status line checks which definition’s range matches the currently focused view’s command set.
Sourcepub fn add(&mut self, item: StatusItem)
pub fn add(&mut self, item: StatusItem)
Add an item to this definition
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StatusDef
impl RefUnwindSafe for StatusDef
impl Send for StatusDef
impl Sync for StatusDef
impl Unpin for StatusDef
impl UnsafeUnpin for StatusDef
impl UnwindSafe for StatusDef
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