Types Creation
This commit is contained in:
parent
94f2280570
commit
8337fa3d8f
22 changed files with 1141 additions and 202 deletions
|
|
@ -1,4 +1,3 @@
|
|||
pub mod communication_types;
|
||||
pub mod communication_value;
|
||||
pub mod data_value;
|
||||
pub mod util;
|
||||
|
|
@ -8,17 +7,17 @@ pub use data_value::{DataKind, DataValue};
|
|||
|
||||
pub use util::rand_u32;
|
||||
|
||||
pub use mtp_type_map::{CommTypeId, DataTypeId, TypeMap, Version};
|
||||
pub use mtp_type_map::{
|
||||
CommunicationType, CommunicationTypeId, DataType, DataTypeId, TypeMap, Version,
|
||||
};
|
||||
|
||||
use mtp_common::CodecError;
|
||||
|
||||
pub fn encode(_value: &DataValue, _typemap: &TypeMap) -> Result<Vec<u8>, CodecError> {
|
||||
// write header using typemap.data_id(), serialize value
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn decode(_bytes: &[u8], _typemap: &TypeMap) -> Result<DataValue, CodecError> {
|
||||
// read header, look up type names from typemap, build DataValue
|
||||
todo!()
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue