nt_string/lib.rs
1// Copyright 2023 Colin Finck <colin@reactos.org>
2// SPDX-License-Identifier: MIT OR Apache-2.0
3//
4//! Provides idiomatic Rust implementations for various Windows string types:
5//!
6//! * [`NtUnicodeString`] (with [`NtUnicodeStr`] and [`NtUnicodeStrMut`]):
7//! For interfacing with the Windows kernel string type known as [`UNICODE_STRING`]
8//! * [`U16StrLe`]:
9//! For working with byte slices of UTF-16 (little-endian) strings
10//!
11//! Other useful UTF-16 string types are already provided by the excellent [`widestring`] crate.
12//! This crate tries to integrate as best as possible with them.
13//!
14//! [`NtUnicodeStr`]: crate::unicode_string::NtUnicodeStr
15//! [`NtUnicodeString`]: crate::unicode_string::NtUnicodeString
16//! [`NtUnicodeStrMut`]: crate::unicode_string::NtUnicodeStrMut
17//! [`U16StrLe`]: crate::u16strle::U16StrLe
18//! [`UNICODE_STRING`]: https://learn.microsoft.com/windows/win32/api/ntdef/ns-ntdef-_unicode_string
19//! [`widestring`]: https://crates.io/crates/widestring
20
21#![cfg_attr(not(feature = "std"), no_std)]
22#![cfg_attr(docsrs, feature(doc_cfg))]
23#![warn(missing_docs)]
24
25#[cfg(feature = "alloc")]
26extern crate alloc;
27
28pub use widestring;
29
30mod error;
31pub use error::*;
32
33mod helpers;
34
35mod macros;
36pub use macros::*;
37
38pub mod traits;
39pub mod u16strle;
40pub mod unicode_string;