#![deny(missing_docs)]
#![doc = include_str!("../README.md")]
#![cfg_attr(not(feature = "std"), no_std)]
pub mod slice;
pub mod tensor;
pub mod cryptotensors;
pub mod encryption;
pub mod key;
pub mod policy;
pub mod registry;
pub mod signing;
#[cfg(feature = "std")]
pub use tensor::{rewrap, rewrap_file, rewrap_header, serialize_to_file};
pub use tensor::{serialize, Dtype, Metadata, SafeTensorError, SafeTensors, View};
pub use cryptotensors::{
CryptoTensors, CryptoTensorsError, DeserializeCryptoConfig, SerializeCryptoConfig,
};
pub use key::KeyMaterial;
pub use policy::AccessPolicy;
pub use registry::{
disable_provider, enable_provider, get_master_key, get_signing_key, get_verify_key,
load_provider_native, register_provider, register_provider_with_priority, DirectKeyProvider,
KeyProvider, PRIORITY_DIRECT, PRIORITY_ENV, PRIORITY_FILE, PRIORITY_NATIVE, PRIORITY_TEMP,
};
#[cfg(feature = "provider-env")]
pub use registry::EnvKeyProvider;
#[cfg(feature = "provider-file")]
pub use registry::FileKeyProvider;
#[cfg(not(feature = "std"))]
#[macro_use]
extern crate alloc;
mod lib {
#[cfg(not(feature = "std"))]
mod no_stds {
pub use alloc::borrow::Cow;
pub use alloc::string::{String, ToString};
pub use alloc::vec::Vec;
pub use hashbrown::HashMap;
}
#[cfg(feature = "std")]
mod stds {
pub use std::borrow::Cow;
pub use std::collections::HashMap;
pub use std::string::{String, ToString};
pub use std::vec::Vec;
}
#[cfg(not(feature = "std"))]
pub use no_stds::*;
#[cfg(feature = "std")]
pub use stds::*;
}