16 releases (8 breaking)

0.8.0 Dec 23, 2025
0.7.0 Sep 13, 2025
0.6.1 May 18, 2025
0.5.0 Dec 23, 2024
0.1.1 Dec 15, 2023

#14 in #zero-copy-ipc

Download history 8182/week @ 2025-09-22 4739/week @ 2025-09-29 5722/week @ 2025-10-06 6253/week @ 2025-10-13 3715/week @ 2025-10-20 3593/week @ 2025-10-27 4145/week @ 2025-11-03 3967/week @ 2025-11-10 5376/week @ 2025-11-17 4111/week @ 2025-11-24 4956/week @ 2025-12-01 5893/week @ 2025-12-08 4784/week @ 2025-12-15 2538/week @ 2025-12-22 2096/week @ 2025-12-29 4975/week @ 2026-01-05

14,858 downloads per month
Used in 29 crates (14 directly)

MIT/Apache

315KB
5K SLoC

iceoryx2 Building Blocks (BB) Container

This is a support library for iceoryx2 which comes with containers that are compatible with shared memory and can be used to construct custom payload types for inter-process communication.

Most containers come in 3 variations:

  1. FixedSize*Container*, compile-time fixed size version. The capacity must be known at compile time. Those fixed-size constructs are always self-contained, meaning that the required memory is part of the constructs and usually stored in some kind of array.
  2. Relocatable*Container*, run-time fixed size version that is shared memory compatible. The capacity must be known when the object is created. This object is not movable!
  3. *Container*, run-time fixed size version that is not shared memory compatible but can be moved. The memory is by default stored on the heap.

Example

1. Compile-Time FixedSize Containers

We create a struct consisting of compile-time fixed size containers that can be used for zero copy inter-process communication.


use iceoryx2_bb_container::string::*;
use iceoryx2_bb_container::vector::*;

const TEXT_CAPACITY: usize = 123;
const DATA_CAPACITY: usize = 456;

#[repr(C)]
struct MyMessageType {
    some_text: StaticString<TEXT_CAPACITY>,
    some_data: StaticVec<u64, DATA_CAPACITY>,
}

let my_message = MyMessageType {
    some_text: StaticString::from_bytes(b"Hello World")?,
    some_data: StaticVec::new(),
};

2. Shared Memory Compatible Run-Time FixedSize Containers

Despite that the containers are already implemented, iceoryx2 itself does not yet support run-time fixed size types. It is planned and will be part of an upcoming release.

3. Run-Time FixedSize Containers

We create a struct consisting of run-time fixed size containers. This can be interesting when it shall be used in a safety-critical environment where everything must be pre-allocated to ensure that required memory is always available.


use iceoryx2_bb_container::queue::*;

const QUEUE_CAPACITY: usize = 123;

#[repr(C)]
struct MyType {
    some_queue: Queue<u64>,
}

let my_thing = MyType {
    some_queue: Queue::new(QUEUE_CAPACITY),
};

Dependencies

~0.3–1MB
~22K SLoC