pub trait Disjoint<T: IsBound>: IsBound { }Expand description
Check if dynamic trait bound is disjoint from another dynamic trait bound.
A bound is disjoint when it contains none of the same traits.
For example, T: X + Y is disjoint from T: Z.
The Empty bound is considered disjoint from all bounds.
This trait is sealed and cannot be implemented outside of the implementations here.
§Examples
use dungeon_cell::bound::{Disjoint, bounds};
use dungeon_cell::marker_traits::IsBound;
fn test<A: Disjoint<B> + IsBound, B: IsBound>() {}
test::<bounds::Empty, bounds::Empty>();
test::<bounds::Send, bounds::Sync>();
test::<bounds::Copy, bounds::Normal>();ⓘ
use dungeon_cell::bound::{Disjoint, bounds};
use dungeon_cell::marker_traits::IsBound;
fn test<A: Disjoint<B> + IsBound, B: IsBound>() {}
test::<bounds::CloneCopy, bounds::CopyClone>();
test::<bounds::Normal, bounds::Normal>();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.