yzx_core/lib.rs
1/*
2 * Description: Implementation of basic Zstandard protocols without pipelining
3 * or other allocating methods.
4 *
5 * Copyright (C) 2025 d@nny mc² <dmc2@hypnicjerk.ai>
6 * SPDX-License-Identifier: AGPL-3.0-or-later
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published
10 * by the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22/* Ensure any doctest warnings fail the doctest! */
23#![doc(test(attr(deny(warnings))))]
24/* #![warn(missing_docs)] */
25#![cfg_attr(docsrs, feature(doc_auto_cfg))]
26/* no_std requirements! */
27#![no_std]
28#![cfg_attr(feature = "allocator-api", feature(allocator_api))]
29#![cfg_attr(feature = "allocator-api", feature(ptr_as_uninit))]
30
31//! Implementation of basic Zstandard protocols without pipelining or other allocating methods.
32//!
33//! *See discussion on anonymity concerns.[^anon]*
34//!
35//! [^anon]: [crate::frame::skippable#data-frames-contain-hidden-states]
36
37#[cfg(feature = "allocator-api")]
38extern crate alloc;
39
40pub mod buf_alloc;
41pub mod checksum;
42/* pub mod decompress; */
43pub mod frame;
44/* mod memory; */
45mod unsafe_utils;
46/* pub mod window; */
47
48pub fn f(x: usize) -> usize { x + 1 }
49
50#[cfg(test)]
51mod test {
52 use super::*;
53
54 #[test]
55 fn check_f() {
56 assert_eq!(f(3), 4);
57 }
58}