// Copyright (c) 2022 Xu Shaohua . All rights reserved. // Use of this source is governed by Apache-2.0 License that can be found // in the LICENSE file. use std::mem::size_of; fn print_basic_types() { use hebo_codec::{ BinaryData, BoolData, ByteArray, PacketId, PubTopic, QoS, StringData, StringPairData, U16Data, U32Data, VarInt, }; println!("Binarydata: {}", size_of::()); println!("BoolData: {}", size_of::()); println!("ByteArray: {}", size_of::()); println!("PacketId: {}", size_of::()); println!("PubTopic: {}", size_of::()); println!("QoS: {}", size_of::()); println!("StringData: {}", size_of::()); println!("StringPairData: {}", size_of::()); println!("U16Data: {}", size_of::()); println!("U32Data: {}", size_of::()); println!("VarInt: {}", size_of::()); } fn print_v3_packets() { use hebo_codec::v3::*; println!("==== V3 ===="); println!("ConnectAckPacket: {}", size_of::()); println!("ConnectPacket: {}", size_of::()); println!("DisconnectPacket: {}", size_of::()); println!("PingRequestPacket: {}", size_of::()); println!("PingResponsePacket: {}", size_of::()); println!("PublishAckPacket: {}", size_of::()); println!( "PublishCompletePacket: {}", size_of::() ); println!("PublishPacket: {}", size_of::()); println!( "PublishReceivedPacket: {}", size_of::() ); println!( "PublishReleasePacket: {}", size_of::() ); println!("SubscribeAckPacket: {}", size_of::()); println!("SubscribePacket: {}", size_of::()); println!( "UnsubscribeAckPacket: {}", size_of::() ); println!("UnsubscribePacket: {}", size_of::()); } fn print_v5_packets() { use hebo_codec::v5::*; println!("==== V5 ===="); println!("ConnectAckPacket: {}", size_of::()); println!("ConnectPacket: {}", size_of::()); println!("DisconnectPacket: {}", size_of::()); println!("PingRequestPacket: {}", size_of::()); println!("PingResponsePacket: {}", size_of::()); println!("PublishAckPacket: {}", size_of::()); println!( "PublishCompletePacket: {}", size_of::() ); println!("PublishPacket: {}", size_of::()); println!( "PublishReceivedPacket: {}", size_of::() ); println!( "PublishReleasePacket: {}", size_of::() ); println!("SubscribeAckPacket: {}", size_of::()); println!("SubscribePacket: {}", size_of::()); println!( "UnsubscribeAckPacket: {}", size_of::() ); println!("UnsubscribePacket: {}", size_of::()); println!("Property: {}", size_of::()); println!("Properties: {}", size_of::()); } fn main() { print_basic_types(); print_v3_packets(); print_v5_packets(); }