Crates.io | briny |
lib.rs | briny |
version | 0.3.1 |
created_at | 2025-07-12 01:57:08.833679+00 |
updated_at | 2025-08-23 00:46:20.035375+00 |
description | Low-level enforcement of memory layout integrity |
homepage | |
repository | https://github.com/bobbothe2nd/briny |
max_upload_size | |
id | 1748882 |
size | 61,571 |
briny
briny
is a small, secure crate that prevents many memory bugs with a safe API - sometimes it can help prevent undefined behavior at compile time.
briny encapsulates the minimal necessary use of unsafe
to provide:
UnsafeCell
.The crate avoids over-engineered abstractions, prioritizing direct, minimal, and predictable primitives with well-defined safety boundaries.
Darc
(Direct ARC) and Naarc
(Non-Alloc ARC) offer reference counting for shared data without requiring heap allocation and without using std
.
Both are designed to be Send + Sync
when the underlying type permits, enabling multi-threaded designs in no_std
or constrained environments.
Due to their inherent simplicity, they can usually perform better than Arc
.
NotUnsafeCell
replaces ad-hoc UnsafeCell
usage with a structured, safety-checked API.
It preserves the flexibility of interior mutability while significantly reducing the risk of unsound aliasing or reentrant access.
briny
provides casting utilities that:
transmute
usage.no_std
First - Fully functional without the standard library, with optional alloc
support.unsafe
so it is not spread throughout downstream code.std::sync
.#![no_std]
supportalloc
or std
Contributions, bug reports, and suggestions are welcome! This project aims to help build verifiably secure foundations for low-level and embedded Rust development.
briny
is under an MIT license.