Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions src/internals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,29 @@ unsafe impl UnsafeAnyExt for DebugAny + Send + Sync {}
/// additional bounds.
///
/// There is also an exported alias for this type of `TypeMap`, `CloneAny`.
pub trait CloneAny: Any {
pub trait CloneAny: Any + Send + Sync {
#[doc(hidden)]
fn clone_any(&self) -> Box<CloneAny>;
#[doc(hidden)]
fn clone_any_send(&self) -> Box<CloneAny + Send> where Self: Send;
fn clone_any_send(&self) -> Box<CloneAny + Send>;
#[doc(hidden)]
fn clone_any_sync(&self) -> Box<CloneAny + Sync> where Self: Sync;
fn clone_any_sync(&self) -> Box<CloneAny + Sync>;
#[doc(hidden)]
fn clone_any_send_sync(&self) -> Box<CloneAny + Send + Sync> where Self: Send + Sync;
fn clone_any_send_sync(&self) -> Box<CloneAny + Send + Sync>;
}

impl<T: Any + Clone> CloneAny for T {
impl<T: Any + Clone + Send + Sync> CloneAny for T {
fn clone_any(&self) -> Box<CloneAny> { Box::new(self.clone()) }

fn clone_any_send(&self) -> Box<CloneAny + Send> where Self: Send {
fn clone_any_send(&self) -> Box<CloneAny + Send> {
Box::new(self.clone())
}

fn clone_any_sync(&self) -> Box<CloneAny + Sync> where Self: Sync {
fn clone_any_sync(&self) -> Box<CloneAny + Sync> {
Box::new(self.clone())
}

fn clone_any_send_sync(&self) -> Box<CloneAny + Send + Sync>
where Self: Send + Sync {
fn clone_any_send_sync(&self) -> Box<CloneAny + Send + Sync> {
Box::new(self.clone())
}
}
Expand Down