aboutsummaryrefslogtreecommitdiff
path: root/rust/src/ops.rs
diff options
context:
space:
mode:
authorDavid Pursell <dpursell@google.com>2023-11-22 20:04:06 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-11-22 20:04:06 +0000
commit3c27a70f96de4bc8c736f5ecfe1847d893e163c8 (patch)
tree965847d835efc13f2452a2b152355d06a0be7d5a /rust/src/ops.rs
parent7c2c397cc91163196c2bf1f00d42e012f56654aa (diff)
parentcedb5f00e36fe2c24709f1dd3da51edf7ac81538 (diff)
downloadavb-3c27a70f96de4bc8c736f5ecfe1847d893e163c8.tar.gz
libavb_rs: add slot_verify() API am: cedb5f00e3
Original change: https://android-review.googlesource.com/c/platform/external/avb/+/2816277 Change-Id: Icf7c6eff1d8390074bbf45650c733ce75d9b3995 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'rust/src/ops.rs')
-rw-r--r--rust/src/ops.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/rust/src/ops.rs b/rust/src/ops.rs
index 74f12f5..5846b17 100644
--- a/rust/src/ops.rs
+++ b/rust/src/ops.rs
@@ -279,10 +279,16 @@ pub struct PublicKeyForPartitionInfo {
/// perform `Ops` (Rust)
/// callback
/// ```
-struct UserData<'a>(&'a mut dyn Ops);
+pub(crate) struct UserData<'a>(&'a mut dyn Ops);
+
+impl<'a> UserData<'a> {
+ pub(crate) fn new(ops: &'a mut dyn Ops) -> Self {
+ Self(ops)
+ }
+}
/// Wraps the C `AvbOps` struct with lifetime information for the compiler.
-struct ScopedAvbOps<'a> {
+pub(crate) struct ScopedAvbOps<'a> {
/// `AvbOps` holds a raw pointer to `UserData` with no lifetime information.
avb_ops: AvbOps,
/// This provides the necessary lifetime information so the compiler can make sure that
@@ -291,7 +297,7 @@ struct ScopedAvbOps<'a> {
}
impl<'a> ScopedAvbOps<'a> {
- fn new(user_data: &'a mut UserData<'a>) -> Self {
+ pub(crate) fn new(user_data: &'a mut UserData<'a>) -> Self {
Self {
avb_ops: AvbOps {
// Rust won't transitively cast so we need to cast twice manually, but the compiler