orengine 0.7.0-alpha.1

Optimized ring engine for Rust. It is a lighter and faster asynchronous library than tokio-rs, async-std, may, and even smol.
Documentation
use crate::utils::SpinLock;
use std::sync::Arc;

/// `DroppableElement` writes `value` into `drop_in` on [`Drop`].
///
/// # Usage
///
/// It is used to test [`Drop`] implementations.
pub(crate) struct DroppableElement {
    pub(crate) value: usize,
    pub(crate) drop_in: Arc<SpinLock<Vec<usize>>>,
}

impl DroppableElement {
    /// Creates a new `DroppableElement`.
    pub(crate) fn new(value: usize, drop_in: Arc<SpinLock<Vec<usize>>>) -> Self {
        Self { value, drop_in }
    }
}

impl Drop for DroppableElement {
    fn drop(&mut self) {
        self.drop_in.lock().push(self.value);
    }
}