| Crates.io | libdd-tinybytes |
| lib.rs | libdd-tinybytes |
| version | 1.0.0 |
| created_at | 2025-11-17 14:11:20.749527+00 |
| updated_at | 2025-11-17 14:11:20.749527+00 |
| description | Tiny implementation of a bytes::Bytes like type that supports AsRef<[u8]> |
| homepage | https://github.com/DataDog/libdatadog/tree/main/libdd-tinybytes |
| repository | https://github.com/DataDog/libdatadog/tree/main/libdd-tinybytes |
| max_upload_size | |
| id | 1936846 |
| size | 44,508 |
A lightweight alternative to bytes::Bytes providing immutable, reference-counted byte buffers with zero-copy cloning and slicing.
libdd-tinybytes provides an immutable byte buffer type similar to bytes::Bytes with a focus on simplicity and AsRef<[u8]> support. It uses reference counting to enable efficient zero-copy operations.
An immutable byte buffer that supports:
Bytes instances shares the underlying buffer through reference counting&'static [u8] without reference counting overheadSend + Sync for safe use across threads&[u8]A UTF-8 validated string type built on top of Bytes (enabled with the bytes_string feature):
AsRef<str> and Borrow<str> implementationsBytesThe crate uses a custom reference counting implementation optimized for its specific use case, tracking only strong references. Individual deallocations do not free memory; instead, memory is reclaimed when the last reference is dropped.
bytes_string: Enable the BytesString UTF-8 validated string typeserialization: Enable serde support for serializationCopyright 2024-Present Datadog, Inc. https://www.datadoghq.com/
SPDX-License-Identifier: Apache-2.0