Skip to main content

Crate burn_after_reading

Crate burn_after_reading 

Source
Expand description

§Burn After Reading

Crates.io docs.rs

§Description

A BAR (burn-after-reading) container works the following way:

  • A value is contained & owned by the container.
    • A best-effort attempt is made to mlock(2) the value
  • The container is completely immutable (if you need to mutate the data, do so before inserting it in the container)
  • The data contained is non-extractible (unless you transmute the container back to Option<S> wink wink)
  • To read the data from it, you call read, which returns you a BarGuard and empties the Bar container.
  • Once the BarGuard is dropped, all the data gets zeroed out and dropped. Poof.
    • munlock(2) also happens here

Compatible with WASM, but without any mlock/munlock because it doesn’t exist there (yet)!

§Documentation

Here: https://docs.rs/burn-after-reading

§AI Disclaimer

Unlike a lot of things being created currently, this library was written WITHOUT the use of any LLM.

§License

Licensed under either of these:

Structs§

Bar
BarGuard