[−][src]Struct genie_hki::HotkeyInfo
Represents a HKI file containing hotkey settings.
Methods
impl HotkeyInfo
[src]
pub fn from<R: Read>(input: &mut R) -> Result<Self>
[src]
Read a hotkey info file.
pub fn write_to<W: Write>(&self, output: &mut W) -> Result<()>
[src]
Write a hotkey info file.
pub fn version(&self) -> f32
[src]
Get the file version.
use std::fs::File; use genie_hki::HotkeyInfo; let mut f = File::open("test/files/aoc1.hki").unwrap(); let info = HotkeyInfo::from(&mut f).expect("failed to read file"); assert_eq!(info.version(), 1.0); let mut f = File::open("test/files/hd0.hki").unwrap(); let info = HotkeyInfo::from(&mut f).expect("failed to read file"); assert_eq!(info.version(), 3.0);
pub fn group(&self, group_id: HotkeyGroupId) -> Option<&HotkeyGroup>
[src]
Get a hotkey group. Groups may not exist in every file.
use std::fs::File; use genie_hki::{HotkeyInfo, HotkeyGroupId}; let mut f = File::open("test/files/aoc1.hki").unwrap(); let info = HotkeyInfo::from(&mut f).expect("failed to read file"); assert!(info.group(HotkeyGroupId::Villager).is_some()); assert!(info.group(HotkeyGroupId::Mill).is_none());
pub fn group_mut(&mut self, group_id: HotkeyGroupId) -> Option<&mut HotkeyGroup>
[src]
Trait Implementations
impl Clone for HotkeyInfo
[src]
fn clone(&self) -> HotkeyInfo
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for HotkeyInfo
[src]
Auto Trait Implementations
impl Send for HotkeyInfo
impl Sync for HotkeyInfo
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,