// SPDX-License-Identifier: MIT
useserde::{Serialize,de::DeserializeOwned};/// Trait implemented by typed network messages.
////// `#[netmsg]` generates this automatically for concrete message structs.
pubtraitNetMessage: Serialize + DeserializeOwned + Clone + Send + Sync + 'static {/// Fully qualified type path used to produce a stable wire identifier.
constTYPE_PATH:&'staticstr;/// Stable wire identifier derived from `TYPE_PATH`.
constWIRE_ID:u64;}/// FNV-1a hash used to derive wire identifiers from type paths.
pubconstfnhash_type_path(type_path:&str)->u64{let bytes = type_path.as_bytes();letmut hash:u64=0xcbf29ce484222325;letmut index =0;while index < bytes.len(){
hash ^= bytes[index]asu64;
hash = hash.wrapping_mul(0x100000001b3);
index +=1;}
hash
}