Trait Pooling
pub trait Pooling<E = <Self as Fallible>::Error> {
// Required methods
fn start_pooling(&mut self, address: usize) -> PoolingState;
unsafe fn finish_pooling(
&mut self,
address: usize,
ptr: ErasedPtr,
drop: unsafe fn(_: ErasedPtr),
) -> Result<(), E> ⓘ;
}
Available on crate feature
dep_rkyv
only.Expand description
A shared pointer deserialization strategy.
This trait is required to deserialize Rc
and Arc
.
Required Methods§
fn start_pooling(&mut self, address: usize) -> PoolingState
fn start_pooling(&mut self, address: usize) -> PoolingState
Starts pooling the value associated with the given address.
unsafe fn finish_pooling(
&mut self,
address: usize,
ptr: ErasedPtr,
drop: unsafe fn(_: ErasedPtr),
) -> Result<(), E> ⓘ
unsafe fn finish_pooling( &mut self, address: usize, ptr: ErasedPtr, drop: unsafe fn(_: ErasedPtr), ) -> Result<(), E> ⓘ
Finishes pooling the value associated with the given address.
Returns an error if the given address was not pending.
§Safety
The given drop
function must be valid to call with ptr
.