Skip to main content

Superset

Trait Superset 

Source
pub trait Superset<S: ?Sized> { }
Expand description

Implemented for any set that is a superset of set S.

§Example

assert::superset::<(i32, i16), (i32,)>();
assert::superset::<(i16, i32), (i32,)>();
assert::superset::<(i32,), (i32,)>();
assert::superset::<(i32, i16), (i16, i32)>();
// assert::superset::<(i8, i16), (i32,)>(); // fails to compile

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<S1: ?Sized, S2> Superset<S2> for S1
where S2: Subset<S1> + ?Sized,