Crates.io | reliq |
lib.rs | reliq |
version | 0.3.7 |
created_at | 2025-08-23 13:22:34.56708+00 |
updated_at | 2025-09-04 08:16:23.183256+00 |
description | A portable library of primitive-like constructs. |
homepage | |
repository | |
max_upload_size | |
id | 1807501 |
size | 155,993 |
A lightweight, no_std
compatible library providing fixed-capacity arrays, UTF-8 strings, fixed-precision numeric types, and a generic numeric trait hierarchy. It is designed for portability where heap allocation may be undesirable, and predictablee arithmetic behaviour is required.
push
, pop
, insert
, remove
.swap_insert
/ swap_remove
for unordered collections.as_slice
, as_mut_slice
, and iteration.let mut arr: Array<4, u8> = Array::default();
arr.push(1).unwrap();
arr.push(2).unwrap();
arr.swap_insert(0, 5).unwrap();
assert_eq!(arr.len(), 3);
Utf8<const A: usize>
-- fixed-capacity Utf8 string.push
/pop
of char
, casting between capacities, and encoding/decoding from byte slices.Display
, Debug
, PartialEq
, Eq
, Ord
, and PartialOrd
.let mut s: Utf8<16> = Utf8::default();
s.push('H').unwrap();
s.push('i').unwrap();
assert_eq!(s.as_str(), "Hi");
let mut value = 0;
let result = require(&mut value, |v| {
*v += 1;
Err("rollback")
});
assert_eq!(value, 0);
Apache-2.0
What the app wants, not what is uses.