libobs_wrapper/
unsafe_send.rs

1//! Sendable wrapper types for non-Send types
2//!
3//! This module provides wrapper types that allow non-Send types to be sent
4//! across thread boundaries. Use with caution - these are unsafe by design.
5
6#[derive(Debug, Clone)]
7pub struct Sendable<T>(pub T);
8
9unsafe impl<T> Send for Sendable<T> {}
10unsafe impl<T> Sync for Sendable<T> {}
11
12#[derive(Debug, Hash, Clone, PartialEq, Eq)]
13pub struct SendableComp<T>(pub T);
14
15unsafe impl<T: PartialEq> Send for SendableComp<T> {}
16unsafe impl<T: PartialEq> Sync for SendableComp<T> {}