Trait CloneAny

Source
pub trait CloneAny: Any { }
Expand description

A marker trait meant for use as the A parameter in TypeMap.

This can be used to construct TypeMaps containing only types which implement Clone like so: TypeMap::<CloneAny>::custom(), which produces a TypeMap<CloneAny>. Combine CloneAny with Send or Sync to add additional bounds.

There is also an exported alias for this type of TypeMap, CloneAny.

Trait Implementations§

Source§

impl Clone for Box<dyn CloneAny>

Source§

fn clone(&self) -> Box<dyn CloneAny>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Clone for Box<dyn CloneAny + Send>

Source§

fn clone(&self) -> Box<dyn CloneAny + Send>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Clone for Box<dyn CloneAny + Send + Sync>

Source§

fn clone(&self) -> Box<dyn CloneAny + Send + Sync>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Clone for Box<dyn CloneAny + Sync>

Source§

fn clone(&self) -> Box<dyn CloneAny + Sync>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl UnsafeAnyExt for dyn CloneAny

Source§

unsafe fn downcast_ref_unchecked<T>(&self) -> &T
where T: Any,

Returns a reference to the contained value, assuming that it is of type T. Read more
Source§

unsafe fn downcast_mut_unchecked<T>(&mut self) -> &mut T
where T: Any,

Returns a mutable reference to the contained value, assuming that it is of type T. Read more
Source§

unsafe fn downcast_unchecked<T>(self: Box<Self>) -> Box<T>
where T: Any,

Returns a the contained value, assuming that it is of type T. Read more
Source§

impl UnsafeAnyExt for dyn CloneAny + Send

Source§

unsafe fn downcast_ref_unchecked<T>(&self) -> &T
where T: Any,

Returns a reference to the contained value, assuming that it is of type T. Read more
Source§

unsafe fn downcast_mut_unchecked<T>(&mut self) -> &mut T
where T: Any,

Returns a mutable reference to the contained value, assuming that it is of type T. Read more
Source§

unsafe fn downcast_unchecked<T>(self: Box<Self>) -> Box<T>
where T: Any,

Returns a the contained value, assuming that it is of type T. Read more
Source§

impl UnsafeAnyExt for dyn CloneAny + Send + Sync

Source§

unsafe fn downcast_ref_unchecked<T>(&self) -> &T
where T: Any,

Returns a reference to the contained value, assuming that it is of type T. Read more
Source§

unsafe fn downcast_mut_unchecked<T>(&mut self) -> &mut T
where T: Any,

Returns a mutable reference to the contained value, assuming that it is of type T. Read more
Source§

unsafe fn downcast_unchecked<T>(self: Box<Self>) -> Box<T>
where T: Any,

Returns a the contained value, assuming that it is of type T. Read more
Source§

impl UnsafeAnyExt for dyn CloneAny + Sync

Source§

unsafe fn downcast_ref_unchecked<T>(&self) -> &T
where T: Any,

Returns a reference to the contained value, assuming that it is of type T. Read more
Source§

unsafe fn downcast_mut_unchecked<T>(&mut self) -> &mut T
where T: Any,

Returns a mutable reference to the contained value, assuming that it is of type T. Read more
Source§

unsafe fn downcast_unchecked<T>(self: Box<Self>) -> Box<T>
where T: Any,

Returns a the contained value, assuming that it is of type T. Read more

Implementors§

Source§

impl<T: Any + Clone> CloneAny for T