referrerpolicy=no-referrer-when-downgrade

Derive Macro frame_support::OrdNoBound

source ·
#[derive(OrdNoBound)]
Expand description

Derive Ord but do not bound any generic.

This is useful for type generic over runtime:

trait Config {
		type C: Ord;
}

// Foo implements [`Ord`] because `C` bounds [`Ord`].
// Otherwise compilation will fail with an output telling `c` doesn't implement [`Ord`].
#[derive(EqNoBound, OrdNoBound, PartialEqNoBound, PartialOrdNoBound)]
struct Foo<T: Config> {
		c: T::C,
}

Derive Ord but do no bound any generic. Docs are at frame_support::OrdNoBound.