1#![deny(missing_docs)]
13#![doc = include_str!("../README.md")]
14#![cfg_attr(not(feature = "std"), no_std)]
15pub mod slice;
16pub mod tensor;
17
18pub mod cryptotensors;
21pub mod encryption;
23pub mod key;
25pub mod policy;
27pub mod registry;
29pub mod signing;
31
32#[cfg(feature = "std")]
34pub use tensor::{rewrap, rewrap_file, rewrap_header, serialize_to_file};
35pub use tensor::{serialize, Dtype, Metadata, SafeTensorError, SafeTensors, View};
36
37pub use cryptotensors::{
39 CryptoTensors, CryptoTensorsError, DeserializeCryptoConfig, SerializeCryptoConfig,
40};
41pub use key::KeyMaterial;
42pub use policy::AccessPolicy;
43pub use registry::{
44 disable_provider, enable_provider, get_master_key, get_signing_key, get_verify_key,
45 load_provider_native, register_provider, register_provider_with_priority, DirectKeyProvider,
46 KeyProvider, PRIORITY_DIRECT, PRIORITY_ENV, PRIORITY_FILE, PRIORITY_NATIVE, PRIORITY_TEMP,
47};
48
49#[cfg(feature = "provider-env")]
50pub use registry::EnvKeyProvider;
51#[cfg(feature = "provider-file")]
52pub use registry::FileKeyProvider;
53
54#[cfg(not(feature = "std"))]
55#[macro_use]
56extern crate alloc;
57
58mod lib {
62 #[cfg(not(feature = "std"))]
63 mod no_stds {
64 pub use alloc::borrow::Cow;
65 pub use alloc::string::{String, ToString};
66 pub use alloc::vec::Vec;
67 pub use hashbrown::HashMap;
68 }
69 #[cfg(feature = "std")]
70 mod stds {
71 pub use std::borrow::Cow;
72 pub use std::collections::HashMap;
73 pub use std::string::{String, ToString};
74 pub use std::vec::Vec;
75 }
76 #[cfg(not(feature = "std"))]
78 pub use no_stds::*;
79 #[cfg(feature = "std")]
80 pub use stds::*;
81}