pub unsafe trait ExternalAllocation: Send + 'static {
// Required methods
fn pointer(&self) -> NonNull<u8>;
fn capacity(&self) -> usize;
}Expand description
Memory from the application’s own pool, lent to the SDK for one frame.
The value is dropped, on whichever thread the SDK frees the frame from,
when the SDK no longer needs the memory. See the
ReceiveAllocator callback contract.
§Safety
From creation until the value is dropped:
pointerandcapacitynever change;- the memory is initialized, writable from any thread, addressable by the
CPU, aligned to at least 64 bytes and valid for
capacitybytes; - nothing else reads, writes, frees or remaps it.
Dropping the value must not panic.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".