aboutsummaryrefslogtreecommitdiff
path: root/rust/qemu-api/src/prelude.rs
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2024-11-15 12:20:35 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2024-12-10 18:49:26 +0100
commitc596199f639cdf4cc021c9bc076e4a1e64e9d50f (patch)
treeb03baf9bffed81111d5280bbca9eb6ef4dc7c498 /rust/qemu-api/src/prelude.rs
parent8e194c0ea5cdbae05b77125a582f9927678121ee (diff)
downloadqemu-c596199f639cdf4cc021c9bc076e4a1e64e9d50f.zip
qemu-c596199f639cdf4cc021c9bc076e4a1e64e9d50f.tar.gz
qemu-c596199f639cdf4cc021c9bc076e4a1e64e9d50f.tar.bz2
rust: cell: add BQL-enforcing RefCell variant
Similar to the existing BqlCell, introduce a custom interior mutability primitive that resembles RefCell but accounts for QEMU's threading model. Borrowing the RefCell requires proving that the BQL is held, and attempting to access without the BQL is a runtime panic. Almost all of the code was taken from Rust's standard library, while removing unstable features and probably-unnecessary functionality that amounts to 60% of the original code. A lot of what's left is documentation, as well as unit tests in the form of doctests. These are not yet integrated in "make check" but can be run with "cargo test --doc". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'rust/qemu-api/src/prelude.rs')
0 files changed, 0 insertions, 0 deletions