pub struct KeyboardVariant {
pub config_item: ConfigItem,
}Expand description
A variant of a keyboard layout.
Fields§
§config_item: ConfigItemImplementations§
Source§impl KeyboardVariant
impl KeyboardVariant
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
The name of this variant of a keybaord layout.
Examples found in repository?
examples/layouts.rs (line 9)
1fn main() {
2 println!("Keyboard layouts");
3 let layouts = xkb_data::keyboard_layouts().unwrap();
4 let mut count = 0;
5 for layout in layouts.layouts() {
6 println!(" {}: {}", layout.name(), layout.description());
7 if let Some(variants) = layout.variants() {
8 for variant in variants {
9 println!(" {}: {}", variant.name(), variant.description())
10 }
11 }
12 count += 1;
13 }
14
15 println!("Total layouts without extra sources: {}", count);
16
17 count = 0;
18 let all_layouts = xkb_data::all_keyboard_layouts().unwrap();
19 for layout in all_layouts.layouts() {
20 println!(" {}: {}", layout.name(), layout.description());
21 if let Some(variants) = layout.variants() {
22 for variant in variants {
23 println!(" {}: {}", variant.name(), variant.description())
24 }
25 }
26 count += 1;
27 }
28 println!("Total layouts including extra sources: {}", count);
29}Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
A description of this variant of a keyboard layout.
Examples found in repository?
examples/layouts.rs (line 9)
1fn main() {
2 println!("Keyboard layouts");
3 let layouts = xkb_data::keyboard_layouts().unwrap();
4 let mut count = 0;
5 for layout in layouts.layouts() {
6 println!(" {}: {}", layout.name(), layout.description());
7 if let Some(variants) = layout.variants() {
8 for variant in variants {
9 println!(" {}: {}", variant.name(), variant.description())
10 }
11 }
12 count += 1;
13 }
14
15 println!("Total layouts without extra sources: {}", count);
16
17 count = 0;
18 let all_layouts = xkb_data::all_keyboard_layouts().unwrap();
19 for layout in all_layouts.layouts() {
20 println!(" {}: {}", layout.name(), layout.description());
21 if let Some(variants) = layout.variants() {
22 for variant in variants {
23 println!(" {}: {}", variant.name(), variant.description())
24 }
25 }
26 count += 1;
27 }
28 println!("Total layouts including extra sources: {}", count);
29}Trait Implementations§
Source§impl Clone for KeyboardVariant
impl Clone for KeyboardVariant
Source§fn clone(&self) -> KeyboardVariant
fn clone(&self) -> KeyboardVariant
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KeyboardVariant
impl Debug for KeyboardVariant
Source§impl<'de> Deserialize<'de> for KeyboardVariant
impl<'de> Deserialize<'de> for KeyboardVariant
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for KeyboardVariant
impl RefUnwindSafe for KeyboardVariant
impl Send for KeyboardVariant
impl Sync for KeyboardVariant
impl Unpin for KeyboardVariant
impl UnwindSafe for KeyboardVariant
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