use ;
/// Wrapper for running a C-defined finalizer over foreign data upon [`Drop`].
///
/// # Safety
///
/// The [`Send`] and [`Sync`] implementations for this type are only safe if
/// the C caller ensures the following invariants:
///
/// - The `data` pointer must remain valid for the lifetime of this value and
/// must be safe to access from any thread.
/// - The `finalizer` function (if provided) must be safe to call from any
/// thread when this value is dropped.
/// - The data pointed to by `data` must not be concurrently mutated without
/// proper synchronization on the C side.
// SAFETY: The C caller is responsible for ensuring that `data` and
// `finalizer` are safe to send across thread boundaries and access
// from multiple threads. See the struct-level safety documentation.
unsafe
unsafe
/// Convenience method for creating a shared Rust slice from C inputs.
///
/// # Note
///
/// Returns an empty Rust slice if `len` is 0 disregarding `ptr`.
pub unsafe
/// Initialize a `MaybeUninit<T>` with `value`.
///
/// # ToDo
///
/// Replace calls to this function with [`MaybeUninit::write`] once it is stable.
///
/// [`MaybeUninit::write`]: https://doc.rust-lang.org/nightly/std/mem/union.MaybeUninit.html#method.write
pub