summaryrefslogtreecommitdiff
path: root/rust/src/backgroundtask.rs
diff options
context:
space:
mode:
authorRubens Brandao <git@rubens.io>2024-05-03 13:28:53 -0300
committerKyle Martin <krm504@nyu.edu>2024-05-10 12:00:27 -0400
commitea7a22b16fc56c23af397dd690c6c839dfb3a8f1 (patch)
tree45f3ba19172017694388ab6f7266e23df76bb670 /rust/src/backgroundtask.rs
parent015314d34d073a8ebbd958edf8150a81381f12c2 (diff)
hide array implementation details
Diffstat (limited to 'rust/src/backgroundtask.rs')
-rw-r--r--rust/src/backgroundtask.rs13
1 files changed, 3 insertions, 10 deletions
diff --git a/rust/src/backgroundtask.rs b/rust/src/backgroundtask.rs
index e62cfbcb..e5fa6e77 100644
--- a/rust/src/backgroundtask.rs
+++ b/rust/src/backgroundtask.rs
@@ -104,21 +104,14 @@ unsafe impl RefCountable for BackgroundTask {
impl CoreArrayProvider for BackgroundTask {
type Raw = *mut BNBackgroundTask;
type Context = ();
+ type Wrapped<'a> = Guard<'a, BackgroundTask>;
}
-unsafe impl CoreOwnedArrayProvider for BackgroundTask {
+unsafe impl CoreArrayProviderInner for BackgroundTask {
unsafe fn free(raw: *mut *mut BNBackgroundTask, count: usize, _context: &()) {
BNFreeBackgroundTaskList(raw, count);
}
-}
-
-unsafe impl CoreArrayWrapper for BackgroundTask {
- type Wrapped<'a> = Guard<'a, BackgroundTask>;
-
- unsafe fn wrap_raw<'a>(
- raw: &'a *mut BNBackgroundTask,
- context: &'a (),
- ) -> Self::Wrapped<'a> {
+ unsafe fn wrap_raw<'a>(raw: &'a *mut BNBackgroundTask, context: &'a ()) -> Self::Wrapped<'a> {
Guard::new(BackgroundTask::from_raw(*raw), context)
}
}