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>;
}
Expand description
A shared pointer deserialization strategy.
This trait is required to deserialize Rc
and Arc
.
Required Methods§
Sourcefn start_pooling(&mut self, address: usize) -> PoolingState
fn start_pooling(&mut self, address: usize) -> PoolingState
Starts pooling the value associated with the given address.
Sourceunsafe 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
.