#volatile #cell #volatility

volcell

A container type that can hold volatile data and allow for safe reads and mutation of its contents with support for use in packed structs

1 stable release

1.0.0 Jun 24, 2023

#2303 in Rust patterns

MPL-2.0 license

8KB
128 lines

volcell

The volcell crate provides the container type VolatileCell which prevents memory accesses to its data from being optimized away by the compiler.
This is useful for example when writing to memory that needs to be read by either another process or the kernel and when writing to buffers that are used to interface with hardware (e.g. the VGA buffer or an APIC register). VolatileCell can be used in packed structs when enabling the unstable feature and using the nightly Rust toolchain.

Contributing

This project is open to any sorts of contributions, be it by notifying me of an issue with the library or by directly contributing code. Since I want to keep this library small and simple, however, you should open an issue to discuss the changes you want to make before starting work on a pull request.

License

Copyright 2023, TeleportAura This software is licensed under the MPL 2.0 license

No runtime deps

Features