aboutsummaryrefslogtreecommitdiff
path: root/rust/bql
diff options
context:
space:
mode:
Diffstat (limited to 'rust/bql')
-rw-r--r--rust/bql/Cargo.toml1
-rw-r--r--rust/bql/meson.build1
-rw-r--r--rust/bql/src/cell.rs23
3 files changed, 17 insertions, 8 deletions
diff --git a/rust/bql/Cargo.toml b/rust/bql/Cargo.toml
index d5177e5..8fd8131 100644
--- a/rust/bql/Cargo.toml
+++ b/rust/bql/Cargo.toml
@@ -13,7 +13,6 @@ repository.workspace = true
rust-version.workspace = true
[dependencies]
-migration = { path = "../migration" }
glib-sys.workspace = true
[features]
diff --git a/rust/bql/meson.build b/rust/bql/meson.build
index 22d7c9b..091372d 100644
--- a/rust/bql/meson.build
+++ b/rust/bql/meson.build
@@ -37,7 +37,6 @@ _bql_rs = static_library(
override_options: ['rust_std=2021', 'build.rust_std=2021'],
rust_abi: 'rust',
rust_args: _bql_cfg,
- link_with: [_migration_rs],
dependencies: [glib_sys_rs],
)
diff --git a/rust/bql/src/cell.rs b/rust/bql/src/cell.rs
index 24ab294..8ade7db 100644
--- a/rust/bql/src/cell.rs
+++ b/rust/bql/src/cell.rs
@@ -151,8 +151,6 @@ use std::{
ptr::NonNull,
};
-use migration::impl_vmstate_transparent;
-
/// A mutable memory location that is protected by the Big QEMU Lock.
///
/// # Memory layout
@@ -364,8 +362,6 @@ impl<T: Default> BqlCell<T> {
}
}
-impl_vmstate_transparent!(crate::cell::BqlCell<T> where T: VMState);
-
/// A mutable memory location with dynamically checked borrow rules,
/// protected by the Big QEMU Lock.
///
@@ -580,6 +576,23 @@ impl<T> BqlRefCell<T> {
}
}
+ /// Returns a mutable reference to the underlying data in this cell,
+ /// while the owner already has a mutable reference to the cell.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use bql::BqlRefCell;
+ ///
+ /// let mut c = BqlRefCell::new(5);
+ ///
+ /// *c.get_mut() = 10;
+ /// ```
+ #[inline]
+ pub const fn get_mut(&mut self) -> &mut T {
+ self.value.get_mut()
+ }
+
/// Returns a raw pointer to the underlying data in this cell.
///
/// # Examples
@@ -674,8 +687,6 @@ impl<T> From<T> for BqlRefCell<T> {
}
}
-impl_vmstate_transparent!(crate::cell::BqlRefCell<T> where T: VMState);
-
struct BorrowRef<'b> {
borrow: &'b Cell<BorrowFlag>,
}