byteor_redaction/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2#![deny(missing_docs)]
3#![deny(unreachable_pub, rust_2018_idioms)]
4#![forbid(unsafe_code)]
5
6//! ByteOr redaction transforms.
7//!
8//! Intended for DataGuard: deterministic policy enforcement and redaction steps.
9
10#[cfg(all(not(feature = "std"), not(feature = "alloc")))]
11compile_error!("byteor-redaction requires feature `alloc` when built without `std`.");
12
13#[cfg(feature = "std")]
14extern crate std;
15
16#[cfg(feature = "alloc")]
17extern crate alloc;
18
19#[cfg(feature = "alloc")]
20pub(crate) use alloc::{borrow, collections::BTreeMap, format, string, string::String, vec::Vec};
21
22#[cfg(all(not(feature = "alloc"), feature = "std"))]
23pub(crate) use std::{borrow, collections::BTreeMap, format, string, string::String, vec::Vec};
24
25mod ops;
26mod parse;
27#[cfg(test)]
28mod tests;
29mod types;
30
31pub use ops::{apply_action, apply_action_to_str, enforce_in_place};
32pub use parse::{parse_action, parse_mode};
33pub use types::{
34    Action, ActionOutcome, EnforcementMode, HashAlgo, Outcome, OutcomeCode, Record,
35    RedactionPolicy, Rule, Value,
36};