asdf-overlay-common 0.6.1

Asdf Overlay Ipc messages, client and server
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use core::num::NonZeroU8;

use bincode::{Decode, Encode};

#[derive(Debug, Clone, Encode, Decode, Copy, Hash, PartialEq, Eq)]
pub struct Key {
    pub code: NonZeroU8,
    pub extended: bool,
}

impl Key {
    pub fn new(code: u8, extended: bool) -> Option<Self> {
        NonZeroU8::new(code).map(|code| Key { code, extended })
    }
}