pub trait PMEMobjpoolEx
{
#[inline(always)]
fn close(self);
#[inline(always)]
fn persist(self, address: *const c_void, length: usize);
#[inline(always)]
fn copy_nonoverlapping_then_persist(self, address: *mut c_void, length: usize, from: *const c_void);
#[inline(always)]
fn write_bytes_then_persist(self, address: *mut c_void, count: usize, value: u8);
}
impl PMEMobjpoolEx for *mut PMEMobjpool
{
#[inline(always)]
fn close(self)
{
unsafe { pmemobj_close(self) }
}
#[inline(always)]
fn persist(self, address: *const c_void, length: usize)
{
unsafe { pmemobj_persist(self, address, length) }
}
#[inline(always)]
fn copy_nonoverlapping_then_persist(self, address: *mut c_void, length: usize, from: *const c_void)
{
debug_assert!(!from.is_null(), "from must not be null");
unsafe { pmemobj_memcpy_persist(self, address, from, length) };
}
#[inline(always)]
fn write_bytes_then_persist(self, address: *mut c_void, count: usize, value: u8)
{
unsafe { pmemobj_memset_persist(self, address, value as i32, count) };
}
}