osc-ir
⚠️ EXPERIMENTAL ⚠️
This crate is experimental and APIs may change significantly between versions.
A protocol-agnostic Intermediate Representation (IR) for OSC-adjacent data structures, designed to work seamlessly with JSON, MessagePack, and other serialization formats.
Features
- OSC Version Support: Configurable OSC 1.0 and OSC 1.1 support via feature flags
- no_std Compatible: Core functionality works without std (requires
allocfeature for owned containers) - Bundle Support: Full OSC Bundle implementation with nested bundle support
- Flexible Types: Support for all OSC types including timestamps, binary data, and extensible types
- Serde Integration: Optional serde support for JSON/MessagePack serialization
Usage
Add this to your Cargo.toml:
[]
= "0.1.0-alpha.1"
Basic Example
use ;
// Create basic values
let message = from;
let number = from;
let boolean = from;
// Create arrays
let array = from;
// Create bundles with timetags
let mut bundle = new;
bundle.add_message;
bundle.add_message;
let bundle_value = Bundle;
OSC 1.1 Features
Enable OSC 1.1 support for additional types:
[]
= { = "0.1.0-alpha.1", = ["osc11"] }
use IrValue;
// OSC 1.1 Color type (RGBA)
let color = color;
// OSC 1.1 MIDI message
let midi = midi;
Serde Support
For JSON/MessagePack serialization:
[]
= { = "0.1.0-alpha.1", = ["serde"] }
Feature Flags
alloc(default): Enable owned containers (Vec, String, etc.) for no_std environmentsserde: Enable serde serialization supportosc10(default): OSC 1.0 support (bundles, timetags, basic types)osc11: OSC 1.1 support (includes OSC 1.0 plus Color and MIDI types)
no_std Support
The crate works in no_std environments with the alloc feature:
[]
= { = "0.1.0-alpha.1", = false, = ["alloc"] }
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.