Trait PoolDefaultImpl

Source
pub trait PoolDefaultImpl: Default { }
Expand description

A marker trait for types which should be fully initialised.

Implementing this trait for a type provides a PoolDefault implementation which writes the result of Default::default() to its memory location.

For types which implement Clone, this will also provide an implementation of PoolClone that writes the result of Clone::clone() to its memory location.

This makes sense for most types, and these implementations are always correct, but you may wish to provide your own implementations for types which don’t have to fully initialise their allocated memory regions, which is why we don’t implement PoolDefault for anything that implements Default and PoolClone for anything that implements Clone, given the absence of trait specialisation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl PoolDefaultImpl for bool

Source§

impl PoolDefaultImpl for i8

Source§

impl PoolDefaultImpl for i16

Source§

impl PoolDefaultImpl for i32

Source§

impl PoolDefaultImpl for i64

Source§

impl PoolDefaultImpl for i128

Source§

impl PoolDefaultImpl for isize

Source§

impl PoolDefaultImpl for u8

Source§

impl PoolDefaultImpl for u16

Source§

impl PoolDefaultImpl for u32

Source§

impl PoolDefaultImpl for u64

Source§

impl PoolDefaultImpl for u128

Source§

impl PoolDefaultImpl for usize

Source§

impl PoolDefaultImpl for String

Source§

impl PoolDefaultImpl for PathBuf

Source§

impl<A> PoolDefaultImpl for Option<A>

Source§

impl<A> PoolDefaultImpl for LinkedList<A>

Source§

impl<A> PoolDefaultImpl for VecDeque<A>

Source§

impl<A> PoolDefaultImpl for Vec<A>

Source§

impl<A, B> PoolDefaultImpl for (A, B)

Source§

impl<A, B, C> PoolDefaultImpl for (A, B, C)

Source§

impl<A, B, C, D> PoolDefaultImpl for (A, B, C, D)

Source§

impl<A, B, C, D, E> PoolDefaultImpl for (A, B, C, D, E)

Source§

impl<A, B, C, D, E, F> PoolDefaultImpl for (A, B, C, D, E, F)

Source§

impl<A, B, C, D, E, F, G> PoolDefaultImpl for (A, B, C, D, E, F, G)

Source§

impl<A, B, C, D, E, F, G, H> PoolDefaultImpl for (A, B, C, D, E, F, G, H)

Source§

impl<A: Ord> PoolDefaultImpl for BinaryHeap<A>

Source§

impl<A: Ord> PoolDefaultImpl for BTreeSet<A>

Source§

impl<A: Ord, B> PoolDefaultImpl for BTreeMap<A, B>

Source§

impl<A: Hash + Eq, B, S: BuildHasher + Default> PoolDefaultImpl for HashMap<A, B, S>

Source§

impl<A: Hash + Eq, S: BuildHasher + Default> PoolDefaultImpl for HashSet<A, S>

Implementors§