[][src]Struct genie_hki::HotkeyInfo

pub struct HotkeyInfo { /* fields omitted */ }

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_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]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.