1mod codec;
9mod compose;
10mod descriptor;
11mod error;
12pub mod format;
13mod message;
14mod resource;
15mod session;
16pub mod shortcut;
17mod text;
18mod types;
19mod value;
20
21pub use codec::{
22 CodecError, Reader, Writer, decode, decode_state_field, encode, encode_state_field,
23};
24pub use compose::{
25 MODULES_STATE_TYPE, ModulePart, SET_ENABLED, command_offsets, compose, module_state_type,
26 state_offsets,
27};
28pub use descriptor::{
29 CommandPolicy, CommandSpec, Concurrency, DescriptorError, EventSpec, ExternalNames,
30 MODULES_NAMESPACE, OperationKind, ParamSpec, ProtocolDescriptor, RESERVED_NAMESPACES, Retry,
31 Scope, StateField, check_external_names, valid_name,
32};
33pub use error::{CommandError, SchemaError};
34pub use message::{Cancellation, CommandOutcome, CommandStatus, Invocation, StateUpdate};
35pub use resource::check_resource_name;
36pub use session::{SessionCommand, session_catalog};
37pub use text::{LocalizedText, label_key};
38pub use types::{EnumDef, FieldDef, RecordDef, Type, TypeTable, VariantDef};
39pub use value::Value;
40
41pub const PROTOCOL_VERSION: u32 = 1;
44
45pub const DESCRIPTOR_VERSION: u32 = 1;
47
48pub fn fingerprint_bytes(bytes: &[u8]) -> u64 {
50 let mut hash = 0xcbf2_9ce4_8422_2325u64;
51 for byte in bytes {
52 hash ^= u64::from(*byte);
53 hash = hash.wrapping_mul(0x0100_0000_01b3);
54 }
55 hash
56}