11 unstable releases (4 breaking)

0.4.1 Sep 28, 2024
0.4.0 Sep 28, 2024
0.3.0 Apr 18, 2024
0.2.2 Jan 17, 2024
0.0.5 Dec 14, 2023

#10 in #publish-subscribe

Download history 36/week @ 2024-08-23 41/week @ 2024-08-30 100/week @ 2024-09-06 46/week @ 2024-09-13 59/week @ 2024-09-20 465/week @ 2024-09-27 106/week @ 2024-10-04 99/week @ 2024-10-11 115/week @ 2024-10-18 135/week @ 2024-10-25 112/week @ 2024-11-01 146/week @ 2024-11-08 413/week @ 2024-11-15 165/week @ 2024-11-22 373/week @ 2024-11-29 264/week @ 2024-12-06

1,255 downloads per month
Used in 14 crates (7 directly)

MIT/Apache

215KB
3.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::byte_string::*;
use iceoryx2_bb_container::vec::*;

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

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

let my_message = MyMessageType {
    some_text: FixedSizeByteString::from_bytes(b"Hello World")?,
    some_data: FixedSizeVec::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–1.1MB
~23K SLoC