Basic Crypto
This commit is contained in:
parent
02f94993c7
commit
94f2280570
10 changed files with 568 additions and 79 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
pub struct CommTypeId(pub u8);
|
||||
pub struct CommTypeId(pub u16);
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||
pub struct DataTypeId(pub u16);
|
||||
|
|
@ -14,12 +14,12 @@ pub struct Version(pub u16);
|
|||
#[derive(Clone, Debug)]
|
||||
pub struct TypeMap {
|
||||
pub version: Version,
|
||||
pub comm_types: HashMap<String, u8>,
|
||||
pub comm_types: HashMap<String, u16>,
|
||||
pub data_types: HashMap<String, u16>,
|
||||
}
|
||||
|
||||
impl TypeMap {
|
||||
pub fn comm_id(&self, name: &str) -> Option<u8> {
|
||||
pub fn comm_id(&self, name: &str) -> Option<u16> {
|
||||
self.comm_types.get(name).copied()
|
||||
}
|
||||
pub fn data_id(&self, name: &str) -> Option<u16> {
|
||||
|
|
|
|||
Loading…
Reference in a new issue