Skip to content

Commit

Permalink
Adds Send/Sync implementations for SlimmerBox
Browse files Browse the repository at this point in the history
(whenever inner types implement them)
Fixes #3
  • Loading branch information
Qqwy committed Nov 13, 2023
1 parent d33f04f commit cc829b5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,20 @@ where
}
}

unsafe impl<T: Send, SlimmerMetadata: Send> Send for SlimmerBox<T, SlimmerMetadata>
where
T: ?Sized,
T: SlimmerPointee<SlimmerMetadata>,
SlimmerMetadata: TryFrom<<T as Pointee>::Metadata> + TryInto<<T as Pointee>::Metadata> + Copy,
{}

unsafe impl<T: Sync, SlimmerMetadata: Sync> Sync for SlimmerBox<T, SlimmerMetadata>
where
T: ?Sized,
T: SlimmerPointee<SlimmerMetadata>,
SlimmerMetadata: TryFrom<<T as Pointee>::Metadata> + TryInto<<T as Pointee>::Metadata> + Copy,
{}

impl<T, SlimmerMetadata> Drop for SlimmerBox<T, SlimmerMetadata>
where
T: ?Sized,
Expand Down

0 comments on commit cc829b5

Please sign in to comment.