Type Alias frame_support::traits::EnsureOneOf

source ·
pub type EnsureOneOf<L, R> = EitherOfDiverse<L, R>;
👎Deprecated: Use EitherOfDiverse instead
Expand description

“OR gate” implementation of EnsureOrigin allowing for different Success types for L and R, with them combined using an Either type.

Origin check will pass if L or R origin check passes. L is tested first.

Successful origin is derived from the left side.

Aliased Type§

struct EnsureOneOf<L, R>(/* private fields */);

Trait Implementations

source§

impl<OuterOrigin, L: EnsureOrigin<OuterOrigin>, R: EnsureOrigin<OuterOrigin>> EnsureOrigin<OuterOrigin> for EitherOfDiverse<L, R>

§

type Success = Either<<L as EnsureOrigin<OuterOrigin>>::Success, <R as EnsureOrigin<OuterOrigin>>::Success>

A return type.
source§

fn try_origin(o: OuterOrigin) -> Result<Self::Success, OuterOrigin>

Perform the origin check.
source§

fn ensure_origin(o: OuterOrigin) -> Result<Self::Success, BadOrigin>

Perform the origin check.
source§

impl<OuterOrigin, L: EnsureOriginWithArg<OuterOrigin, Argument>, R: EnsureOriginWithArg<OuterOrigin, Argument>, Argument> EnsureOriginWithArg<OuterOrigin, Argument> for EitherOfDiverse<L, R>

§

type Success = Either<<L as EnsureOriginWithArg<OuterOrigin, Argument>>::Success, <R as EnsureOriginWithArg<OuterOrigin, Argument>>::Success>

A return type.
source§

fn try_origin( o: OuterOrigin, a: &Argument, ) -> Result<Self::Success, OuterOrigin>

Perform the origin check, returning the origin value if unsuccessful. This allows chaining.
source§

fn ensure_origin( o: OuterOrigin, a: &Argument, ) -> Result<Self::Success, BadOrigin>

Perform the origin check.