Disjoint

Trait Disjoint 

Source
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.

Implementors§

Source§

impl<SendB, SyncB, CopyB, CloneB, UnpinB, DebugB, SendA, SyncA, CopyA, CloneA, UnpinA, DebugA> Disjoint<Bound<SendB, SyncB, CopyB, CloneB, UnpinB, DebugB>> for Bound<SendA, SyncA, CopyA, CloneA, UnpinA, DebugA>
where Bound<SendA, SyncA, CopyA, CloneA, UnpinA, DebugA>: IsBound, Bound<SendB, SyncB, CopyB, CloneB, UnpinB, DebugB>: IsBound, SendA: DisjointHelper<SendB>, SyncA: DisjointHelper<SyncB>, CopyA: DisjointHelper<CopyB>, CloneA: DisjointHelper<CloneB>, UnpinA: DisjointHelper<UnpinB>, DebugA: DisjointHelper<DebugB>,