@@ -20,7 +20,7 @@ use maitake_sync::{
20
20
wait_map:: { WaitError , WakeOutcome } ,
21
21
WaitMap ,
22
22
} ;
23
- use postcard_schema :: { schema:: owned:: OwnedNamedType , Schema } ;
23
+ use postcard_schema_ng :: { schema:: owned:: OwnedDataModelType , Schema } ;
24
24
use serde:: { de:: DeserializeOwned , Deserialize , Serialize } ;
25
25
use tokio:: {
26
26
select,
@@ -983,7 +983,7 @@ pub struct SchemaReport {
983
983
/// All custom types spoken by the device (on any endpoint or topic),
984
984
/// as well as all primitive types. In the future, primitive types may
985
985
/// be removed.
986
- pub types : HashSet < OwnedNamedType > ,
986
+ pub types : HashSet < OwnedDataModelType > ,
987
987
/// All incoming (client to server) topics reported by the device
988
988
pub topics_in : Vec < TopicReport > ,
989
989
/// All outgoing (server to client) topics reported by the device
@@ -1003,45 +1003,47 @@ impl Default for SchemaReport {
1003
1003
1004
1004
// We need to pre-populate all of the types we consider primitives:
1005
1005
// DataModelType::Bool
1006
- me. add_type ( OwnedNamedType :: from ( <bool as Schema >:: SCHEMA ) ) ;
1006
+ me. add_type ( OwnedDataModelType :: from ( <bool as Schema >:: SCHEMA ) ) ;
1007
1007
// DataModelType::I8
1008
- me. add_type ( OwnedNamedType :: from ( <i8 as Schema >:: SCHEMA ) ) ;
1008
+ me. add_type ( OwnedDataModelType :: from ( <i8 as Schema >:: SCHEMA ) ) ;
1009
1009
// DataModelType::U8
1010
- me. add_type ( OwnedNamedType :: from ( <u8 as Schema >:: SCHEMA ) ) ;
1010
+ me. add_type ( OwnedDataModelType :: from ( <u8 as Schema >:: SCHEMA ) ) ;
1011
1011
// DataModelType::I16
1012
- me. add_type ( OwnedNamedType :: from ( <i16 as Schema >:: SCHEMA ) ) ;
1012
+ me. add_type ( OwnedDataModelType :: from ( <i16 as Schema >:: SCHEMA ) ) ;
1013
1013
// DataModelType::I32
1014
- me. add_type ( OwnedNamedType :: from ( <i32 as Schema >:: SCHEMA ) ) ;
1014
+ me. add_type ( OwnedDataModelType :: from ( <i32 as Schema >:: SCHEMA ) ) ;
1015
1015
// DataModelType::I64
1016
- me. add_type ( OwnedNamedType :: from ( <i64 as Schema >:: SCHEMA ) ) ;
1016
+ me. add_type ( OwnedDataModelType :: from ( <i64 as Schema >:: SCHEMA ) ) ;
1017
1017
// DataModelType::I128
1018
- me. add_type ( OwnedNamedType :: from ( <i128 as Schema >:: SCHEMA ) ) ;
1018
+ me. add_type ( OwnedDataModelType :: from ( <i128 as Schema >:: SCHEMA ) ) ;
1019
1019
// DataModelType::U16
1020
- me. add_type ( OwnedNamedType :: from ( <u16 as Schema >:: SCHEMA ) ) ;
1020
+ me. add_type ( OwnedDataModelType :: from ( <u16 as Schema >:: SCHEMA ) ) ;
1021
1021
// DataModelType::U32
1022
- me. add_type ( OwnedNamedType :: from ( <u32 as Schema >:: SCHEMA ) ) ;
1022
+ me. add_type ( OwnedDataModelType :: from ( <u32 as Schema >:: SCHEMA ) ) ;
1023
1023
// DataModelType::U64
1024
- me. add_type ( OwnedNamedType :: from ( <u64 as Schema >:: SCHEMA ) ) ;
1024
+ me. add_type ( OwnedDataModelType :: from ( <u64 as Schema >:: SCHEMA ) ) ;
1025
1025
// DataModelType::U128
1026
- me. add_type ( OwnedNamedType :: from ( <u128 as Schema >:: SCHEMA ) ) ;
1026
+ me. add_type ( OwnedDataModelType :: from ( <u128 as Schema >:: SCHEMA ) ) ;
1027
1027
// // DataModelType::Usize
1028
- // me.add_type(OwnedNamedType ::from(<usize as Schema>::SCHEMA));
1028
+ // me.add_type(OwnedDataModelType ::from(<usize as Schema>::SCHEMA));
1029
1029
// // DataModelType::Isize
1030
- // me.add_type(OwnedNamedType ::from(<isize as Schema>::SCHEMA));
1030
+ // me.add_type(OwnedDataModelType ::from(<isize as Schema>::SCHEMA));
1031
1031
// DataModelType::F32
1032
- me. add_type ( OwnedNamedType :: from ( <f32 as Schema >:: SCHEMA ) ) ;
1032
+ me. add_type ( OwnedDataModelType :: from ( <f32 as Schema >:: SCHEMA ) ) ;
1033
1033
// DataModelType::F64
1034
- me. add_type ( OwnedNamedType :: from ( <f64 as Schema >:: SCHEMA ) ) ;
1034
+ me. add_type ( OwnedDataModelType :: from ( <f64 as Schema >:: SCHEMA ) ) ;
1035
1035
// DataModelType::Char
1036
- me. add_type ( OwnedNamedType :: from ( <char as Schema >:: SCHEMA ) ) ;
1036
+ me. add_type ( OwnedDataModelType :: from ( <char as Schema >:: SCHEMA ) ) ;
1037
1037
// DataModelType::String
1038
- me. add_type ( OwnedNamedType :: from ( <String as Schema >:: SCHEMA ) ) ;
1038
+ me. add_type ( OwnedDataModelType :: from ( <String as Schema >:: SCHEMA ) ) ;
1039
1039
// DataModelType::ByteArray
1040
- me. add_type ( OwnedNamedType :: from ( <Vec < u8 > as Schema >:: SCHEMA ) ) ;
1040
+ me. add_type ( OwnedDataModelType :: from ( <Vec < u8 > as Schema >:: SCHEMA ) ) ;
1041
1041
// DataModelType::Unit
1042
- me. add_type ( OwnedNamedType :: from ( <( ) as Schema >:: SCHEMA ) ) ;
1042
+ me. add_type ( OwnedDataModelType :: from ( <( ) as Schema >:: SCHEMA ) ) ;
1043
1043
// DataModelType::Schema
1044
- me. add_type ( OwnedNamedType :: from ( <OwnedNamedType as Schema >:: SCHEMA ) ) ;
1044
+ me. add_type ( OwnedDataModelType :: from (
1045
+ <OwnedDataModelType as Schema >:: SCHEMA ,
1046
+ ) ) ;
1045
1047
1046
1048
me
1047
1049
}
@@ -1055,7 +1057,7 @@ pub struct TopicReport {
1055
1057
/// The Key of the topic (which hashes the path and type)
1056
1058
pub key : Key ,
1057
1059
/// The schema of the type of the message
1058
- pub ty : OwnedNamedType ,
1060
+ pub ty : OwnedDataModelType ,
1059
1061
}
1060
1062
1061
1063
/// A description of a single Endpoint
@@ -1066,11 +1068,11 @@ pub struct EndpointReport {
1066
1068
/// The Key of the request (which hashes the path and type)
1067
1069
pub req_key : Key ,
1068
1070
/// The schema of the request type
1069
- pub req_ty : OwnedNamedType ,
1071
+ pub req_ty : OwnedDataModelType ,
1070
1072
/// The Key of the response (which hashes the path and type)
1071
1073
pub resp_key : Key ,
1072
1074
/// The schema of the response type
1073
- pub resp_ty : OwnedNamedType ,
1075
+ pub resp_ty : OwnedDataModelType ,
1074
1076
}
1075
1077
1076
1078
/// An error that denotes we were unable to resolve the type used by a given key
@@ -1079,7 +1081,7 @@ pub struct UnableToFindType;
1079
1081
1080
1082
impl SchemaReport {
1081
1083
/// Insert a new type
1082
- pub fn add_type ( & mut self , t : OwnedNamedType ) {
1084
+ pub fn add_type ( & mut self , t : OwnedDataModelType ) {
1083
1085
self . types . insert ( t) ;
1084
1086
}
1085
1087
0 commit comments