1#![cfg_attr(not(any(test, feature = "std")), no_std)]
5#![cfg_attr(docsrs, feature(doc_cfg))]
6#![warn(non_ascii_idents, trivial_casts, unused, unused_qualifications)]
7#![deny(unsafe_code)]
8
9delog::generate_macros!();
10
11use trussed::backend::Backend;
12
13#[cfg(feature = "virt")]
14pub mod virt;
15
16#[cfg(feature = "wrap-key-to-file")]
17mod wrap_key_to_file;
18
19#[cfg(feature = "fs-info")]
20mod fs_info;
21
22#[cfg(feature = "chunked")]
23mod chunked;
24
25#[cfg(feature = "hkdf")]
26mod hkdf;
27
28#[cfg(feature = "hpke")]
29mod hpke;
30
31#[cfg(feature = "manage")]
32mod manage;
33#[cfg(feature = "manage")]
34pub use manage::State as ManageState;
35
36#[derive(Clone, Debug, Default)]
37#[non_exhaustive]
38pub struct StagingBackend {
39 #[cfg(feature = "manage")]
40 pub manage: ManageState,
41}
42
43impl StagingBackend {
44 pub fn new() -> Self {
45 Self {
46 #[cfg(feature = "manage")]
47 manage: Default::default(),
48 }
49 }
50}
51
52#[derive(Default)]
53#[non_exhaustive]
54pub struct StagingContext {
55 #[cfg(feature = "chunked")]
56 chunked_io_state: Option<chunked::ChunkedIoState>,
57}
58
59impl Backend for StagingBackend {
60 type Context = StagingContext;
61}