[−][src]Struct genie_hki::HotkeyGroup
Represents a group of Hotkey
s.
Different groups may have different numbers of hotkeys.
Implementations
impl HotkeyGroup
[src]
pub fn hotkey(&self, index: usize) -> Option<&Hotkey>
[src]
Returns an immutable reference to a single hotkey, if that hotkey is
present in this HotkeyGroup
.
pub fn hotkey_mut(&mut self, index: usize) -> Option<&mut Hotkey>
[src]
Get a mutable reference to a single hotkey. This way, you can edit or replace the mapping.
pub fn unbind(&self, index: usize) -> Result<Self, HotkeyIndexError>
[src]
Returns a hotkey group equivalent to this group but with the hotkey
at index
unbound so that the key is 0
and all modifier keys are
false
. Returns an error if the index does not exist.
pub fn bind(
&self,
index: usize,
key: i32,
ctrl: bool,
alt: bool,
shift: bool
) -> Result<Self, HotkeyIndexError>
[src]
&self,
index: usize,
key: i32,
ctrl: bool,
alt: bool,
shift: bool
) -> Result<Self, HotkeyIndexError>
Returns a hotkey group equivalent to this group but with the hotkey
at index
bound with the given key and modifier keys.
Returns an error if the index does not exist.
pub fn num_hotkeys(&self) -> usize
[src]
Returns the number of hotkeys in this HotkeyGroup
.
use std::fs::File; use genie_hki::HotkeyInfo; let mut f = File::open("test/files/aoc1.hki")?; let info = HotkeyInfo::from(&mut f)?; // Villager hotkeys are group 3 in AoC and HD Edition. let group = info.group(3).expect("file does not contain villager hotkeys"); assert_eq!(28, group.num_hotkeys());
pub fn iter(&self) -> impl Iterator<Item = &Hotkey>
[src]
Returns an iterator over this group's hotkeys.
pub fn to_string_lang(&self, lang_file: &LangFile, sk: &StringKey) -> String
[src]
Returns a string representation of this hotkey group, using the strings
from lang_file
and the group name string key sk
.
Trait Implementations
impl Clone for HotkeyGroup
[src]
fn clone(&self) -> HotkeyGroup
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for HotkeyGroup
[src]
impl Display for HotkeyGroup
[src]
impl Eq for HotkeyGroup
[src]
impl IntoIterator for HotkeyGroup
[src]
type Item = Hotkey
The type of the elements being iterated over.
type IntoIter = IntoIter<Hotkey>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a> IntoIterator for &'a HotkeyGroup
[src]
type Item = &'a Hotkey
The type of the elements being iterated over.
type IntoIter = Iter<'a, Hotkey>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a> IntoIterator for &'a mut HotkeyGroup
[src]
type Item = &'a mut Hotkey
The type of the elements being iterated over.
type IntoIter = IterMut<'a, Hotkey>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl PartialEq<HotkeyGroup> for HotkeyGroup
[src]
fn eq(&self, other: &HotkeyGroup) -> bool
[src]
fn ne(&self, other: &HotkeyGroup) -> bool
[src]
impl StructuralEq for HotkeyGroup
[src]
impl StructuralPartialEq for HotkeyGroup
[src]
Auto Trait Implementations
impl RefUnwindSafe for HotkeyGroup
impl Send for HotkeyGroup
impl Sync for HotkeyGroup
impl Unpin for HotkeyGroup
impl UnwindSafe for HotkeyGroup
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,