Skip to main content

Crate synapse_primitives

Crate synapse_primitives 

Source
Expand description

Synapse Core - Encoding utilities and optimizations

This crate provides efficient encoding utilities for the Synapse gateway system:

  • id: Strongly-typed identifiers (ServiceId, InterfaceId, MethodId, etc.)
  • siphash: Name-to-ID mapping using SipHash for stable numeric identifiers
  • semver: Decimal semantic version packing into u32
  • flags: Bitfield flag packing for efficient boolean storage
  • binary: Fixed-size binary encodings (UUIDs, timestamps)

Re-exports§

pub use flags::Flags32;
pub use flags::Flags64;
pub use id::HeaderKeyId;
pub use id::InstanceId;
pub use id::InterfaceId;
pub use id::MethodId;
pub use id::MetricId;
pub use id::ServiceId;
pub use semver::PackedVersion;
pub use semver::VersionError;

Modules§

flags
Bitfield flag packing for efficient boolean storage
id
Strongly-typed identifiers with SipHash integration
semver
Decimal semver packing for efficient version representation
siphash
SipHash-based name-to-ID mapping for stable numeric identifiers

Macros§

define_flags
Macro to define a typed flag set with named flags
header_key_id
Macro to compute header key ID
interface_id
Macro to compute interface ID

Structs§

Uuid
A Universally Unique Identifier (UUID).

Functions§

uuid_bytes
Convert a UUID to the wire type