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::{CodecError, Reader, Writer, decode, encode};
22pub use compose::{
23 MODULES_STATE_TYPE, ModulePart, SET_ENABLED, command_offsets, compose, module_state_type,
24};
25pub use descriptor::{
26 CommandPolicy, CommandSpec, Concurrency, DescriptorError, EventSpec, ExternalNames,
27 MODULES_NAMESPACE, OperationKind, ParamSpec, ProtocolDescriptor, RESERVED_NAMESPACES, Retry,
28 Scope, StateField, check_external_names, valid_name,
29};
30pub use error::{CommandError, SchemaError};
31pub use message::{Cancellation, CommandOutcome, CommandStatus, Invocation, StateUpdate};
32pub use resource::check_resource_name;
33pub use session::{SessionCommand, session_catalog};
34pub use text::{LocalizedText, label_key};
35pub use types::{EnumDef, FieldDef, RecordDef, Type, TypeTable, VariantDef};
36pub use value::Value;
37
38pub const PROTOCOL_VERSION: u32 = 1;
41
42pub const DESCRIPTOR_VERSION: u32 = 1;
44
45pub fn fingerprint_bytes(bytes: &[u8]) -> u64 {
47 let mut hash = 0xcbf2_9ce4_8422_2325u64;
48 for byte in bytes {
49 hash ^= u64::from(*byte);
50 hash = hash.wrapping_mul(0x0100_0000_01b3);
51 }
52 hash
53}