pub unsafe trait NativeResource: Sized + 'static {
type Policy: ResourcePolicy;
type Pointer: ResourcePointer<Self>;
}Expand description
Native storage and cleanup policy selected by the generator.
§Safety
A shared policy requires that the native allocation can be retained and closed
from any thread. All safe constructors must use this policy’s checked dependency
and cleanup storage. This does not make concurrent native method calls safe.
CachedPointer additionally requires that native calls cannot release or
replace the allocation while an owning handle remains alive.
Required Associated Types§
type Policy: ResourcePolicy
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".