mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-05 09:14:24 +01:00
24 lines
411 B
Rust
24 lines
411 B
Rust
use std::ops::{Deref, DerefMut};
|
|
|
|
#[derive(Debug)]
|
|
pub struct Wrapper<T> {
|
|
pub inner: T,
|
|
}
|
|
|
|
impl<T> Deref for Wrapper<T> {
|
|
type Target = T;
|
|
|
|
fn deref(&self) -> &Self::Target {
|
|
&self.inner
|
|
}
|
|
}
|
|
|
|
impl<T> DerefMut for Wrapper<T> {
|
|
fn deref_mut(&mut self) -> &mut Self::Target {
|
|
&mut self.inner
|
|
}
|
|
}
|
|
|
|
unsafe impl<T> Send for Wrapper<T> {}
|
|
unsafe impl<T> Sync for Wrapper<T> {}
|