From 181ad567199e5685578ecf7ad400257098c2e175 Mon Sep 17 00:00:00 2001 From: Fabian Freyer Date: Mon, 31 Jan 2022 06:24:07 +0100 Subject: rust: add ArrayGuard and for non-owned arrays To make use of shard functionality, we split the CoreOwnedArrayProvider into CoreArrayProvider and CoreOwnedArrayProvider. Array makes use of the CoreOwnedArrayProvider, which depends on CoreArrayProvider, while the new ArrayGuard only requires CoreArrayProvider and represents a non-owned array. --- rust/src/custombinaryview.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'rust/src/custombinaryview.rs') diff --git a/rust/src/custombinaryview.rs b/rust/src/custombinaryview.rs index b1fda73a..48274fe4 100644 --- a/rust/src/custombinaryview.rs +++ b/rust/src/custombinaryview.rs @@ -245,16 +245,18 @@ impl BinaryViewTypeBase for BinaryViewType { } } -unsafe impl CoreOwnedArrayProvider for BinaryViewType { +impl CoreArrayProvider for BinaryViewType { type Raw = *mut BNBinaryViewType; type Context = (); +} +unsafe impl CoreOwnedArrayProvider for BinaryViewType { unsafe fn free(raw: *mut Self::Raw, _count: usize, _context: &Self::Context) { BNFreeBinaryViewTypeList(raw); } } -unsafe impl<'a> CoreOwnedArrayWrapper<'a> for BinaryViewType { +unsafe impl<'a> CoreArrayWrapper<'a> for BinaryViewType { type Wrapped = BinaryViewType; unsafe fn wrap_raw(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped { -- cgit v1.3.1