resb/
lib.rs

1// This file is part of ICU4X. For terms of use, please see the file
2// called LICENSE at the top level of the ICU4X source tree
3// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
4
5//! `resb` is a utility crate of the [`ICU4X`] project for working with ICU
6//! resource bundle files.
7//!
8//! It comprises modules for reading and optionally writing [`binary`] `.res`
9//! files as well as optionally for reading [`text`] bundles.
10//!
11//! [`ICU4X`]: ../icu/index.html
12
13// https://github.com/unicode-org/icu4x/blob/main/documents/process/boilerplate.md#library-annotations
14#![cfg_attr(not(any(test, feature = "std")), no_std)]
15#![cfg_attr(
16    not(test),
17    deny(
18        clippy::indexing_slicing,
19        clippy::unwrap_used,
20        clippy::expect_used,
21        clippy::panic,
22        clippy::exhaustive_structs,
23        clippy::exhaustive_enums,
24        clippy::trivially_copy_pass_by_ref,
25        missing_debug_implementations,
26    )
27)]
28#![warn(missing_docs)]
29
30extern crate alloc;
31
32pub mod binary;
33
34#[cfg(feature = "text")]
35pub mod text;
36
37#[cfg(any(feature = "serialize", feature = "text"))]
38pub mod bundle;
39
40/// A mask for extracting the least significant 28 bits of a 32-bit integer.
41const MASK_28_BIT: u32 = 0x0fff_ffff;