[−][src]Struct genie_hki::HotkeyInfoMetadata
A list of information about hotkey groups in a hotkey file.
The length is the number of groups in the file.
Each StringKey
in the list is the key of the string that names the group.
The key is stored at the group's offset index in the hotkey file.
Implementations
impl HotkeyInfoMetadata
[src]
pub fn new() -> Self
[src]
Returns an empty HotkeyInfoMetadata
struct.
Examples
use genie_hki::HotkeyInfoMetadata; let him = HotkeyInfoMetadata::new();
pub fn add(&mut self, sk: StringKey)
[src]
Adds a group to the metadata.
Examples
use genie_hki::HotkeyInfoMetadata; use genie_lang::StringKey; let mut him = HotkeyInfoMetadata::new(); him.add(StringKey::from(0u32));
pub fn len(&self) -> usize
[src]
Returns the number of groups described by this metadata.
Examples
use genie_hki::HotkeyInfoMetadata; use genie_lang::StringKey; let mut him = HotkeyInfoMetadata::new(); assert_eq!(0, him.len()); him.add(StringKey::from(0u32)); assert_eq!(1, him.len());
pub fn is_empty(&self) -> bool
[src]
Returns true if this metadata does not contain any groups.
Examples
use genie_hki::HotkeyInfoMetadata; use genie_lang::StringKey; let mut him = HotkeyInfoMetadata::new(); assert!(him.is_empty()); him.add(StringKey::from(0u32)); assert!(!him.is_empty());
pub fn get(&self, index: usize) -> Option<&StringKey>
[src]
Returns Some(sk)
, where sk
is the string key of the group at the
given index
.
Returns None
if no group is located at index
, that is,
if index >= self.len()
.
Examples
use genie_hki::HotkeyInfoMetadata; use genie_lang::StringKey; let mut him = HotkeyInfoMetadata::new(); assert_eq!(None, him.get(0)); him.add(StringKey::from(0u32)); assert_eq!(Some(&StringKey::from(0u32)), him.get(0));
pub fn iter(&self) -> impl Iterator<Item = &StringKey>
[src]
Returns an iterator over the hotkey group metadata contained in this hotkey file's data.
Examples
use genie_hki::HotkeyInfoMetadata; use genie_lang::StringKey; let mut him = HotkeyInfoMetadata::new(); him.add(StringKey::from(0u32)); him.add(StringKey::from(1u32)); let mut iter = him.iter(); assert_eq!(Some(&StringKey::from(0u32)), iter.next()); assert_eq!(Some(&StringKey::from(1u32)), iter.next()); assert_eq!(None, iter.next());
Trait Implementations
impl Clone for HotkeyInfoMetadata
[src]
fn clone(&self) -> HotkeyInfoMetadata
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for HotkeyInfoMetadata
[src]
impl Default for HotkeyInfoMetadata
[src]
fn default() -> HotkeyInfoMetadata
[src]
impl Eq for HotkeyInfoMetadata
[src]
impl From<Vec<StringKey>> for HotkeyInfoMetadata
[src]
impl IntoIterator for HotkeyInfoMetadata
[src]
type Item = StringKey
The type of the elements being iterated over.
type IntoIter = IntoIter<StringKey>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl<'a> IntoIterator for &'a HotkeyInfoMetadata
[src]
type Item = &'a StringKey
The type of the elements being iterated over.
type IntoIter = Iter<'a, StringKey>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
impl PartialEq<HotkeyInfoMetadata> for HotkeyInfoMetadata
[src]
fn eq(&self, other: &HotkeyInfoMetadata) -> bool
[src]
fn ne(&self, other: &HotkeyInfoMetadata) -> bool
[src]
impl StructuralEq for HotkeyInfoMetadata
[src]
impl StructuralPartialEq for HotkeyInfoMetadata
[src]
Auto Trait Implementations
impl RefUnwindSafe for HotkeyInfoMetadata
impl Send for HotkeyInfoMetadata
impl Sync for HotkeyInfoMetadata
impl Unpin for HotkeyInfoMetadata
impl UnwindSafe for HotkeyInfoMetadata
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, 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>,