referrerpolicy=no-referrer-when-downgrade
frame_support::traits

Type Alias 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>

Source§

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 try_successful_origin() -> Result<OuterOrigin, ()>

Attempt to get an outer origin capable of passing try_origin check. May return Err if it is impossible. Read more
Source§

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

Perform the origin check.
Source§

fn ensure_origin_or_root( o: OuterOrigin, ) -> Result<Option<Self::Success>, BadOrigin>
where OuterOrigin: OriginTrait,

The same as ensure_origin except that Root origin will always pass. This can only be used if Success has a sensible impl of Default since that will be used in the result.
Source§

fn try_origin_or_root( o: OuterOrigin, ) -> Result<Option<Self::Success>, OuterOrigin>
where OuterOrigin: OriginTrait,

The same as try_origin except that Root origin will always pass. This can only be used if Success has a sensible impl of Default since that will be used in the result.
Source§

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

Source§

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 try_successful_origin(a: &Argument) -> Result<OuterOrigin, ()>

Attempt to get an outer origin capable of passing try_origin check. May return Err if it is impossible. Read more
Source§

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

Perform the origin check.