use crate::{ api::{ScratchAvailable, ScratchFromBytes, ScratchOwnedAlloc, ScratchOwnedBorrow, TakeSlice}, layouts::{Backend, Scratch, ScratchOwned}, oep::{ScratchAvailableImpl, ScratchFromBytesImpl, ScratchOwnedAllocImpl, ScratchOwnedBorrowImpl, TakeSliceImpl}, }; impl ScratchOwnedAlloc for ScratchOwned where B: Backend + ScratchOwnedAllocImpl, { fn alloc(size: usize) -> Self { B::scratch_owned_alloc_impl(size) } } impl ScratchOwnedBorrow for ScratchOwned where B: Backend + ScratchOwnedBorrowImpl, { fn borrow(&mut self) -> &mut Scratch { B::scratch_owned_borrow_impl(self) } } impl ScratchFromBytes for Scratch where B: Backend + ScratchFromBytesImpl, { fn from_bytes(data: &mut [u8]) -> &mut Scratch { B::scratch_from_bytes_impl(data) } } impl ScratchAvailable for Scratch where B: Backend + ScratchAvailableImpl, { fn available(&self) -> usize { B::scratch_available_impl(self) } } impl TakeSlice for Scratch where B: Backend + TakeSliceImpl, { fn take_slice(&mut self, len: usize) -> (&mut [T], &mut Self) { B::take_slice_impl(self, len) } }