Struct g1_runtime::RuntimeOrigin
source · pub struct RuntimeOrigin {
pub caller: OriginCaller,
pub(crate) filter: Rc<Box<dyn Fn(&<Runtime as Config>::RuntimeCall) -> bool>>,
}
Expand description
The runtime origin type representing the origin of a call.
Origin is always created with the base filter configured in [frame_system::Config::BaseCallFilter
].
Fields§
§caller: OriginCaller
§filter: Rc<Box<dyn Fn(&<Runtime as Config>::RuntimeCall) -> bool>>
Implementations§
Trait Implementations§
source§impl Clone for RuntimeOrigin
impl Clone for RuntimeOrigin
source§fn clone(&self) -> RuntimeOrigin
fn clone(&self) -> RuntimeOrigin
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RuntimeOrigin
impl Debug for RuntimeOrigin
source§impl From<OriginCaller> for RuntimeOrigin
impl From<OriginCaller> for RuntimeOrigin
source§fn from(x: OriginCaller) -> Self
fn from(x: OriginCaller) -> Self
Converts to this type from the input type.
source§impl From<RawOrigin<<Runtime as Config>::AccountId>> for RuntimeOrigin
impl From<RawOrigin<<Runtime as Config>::AccountId>> for RuntimeOrigin
source§impl From<RuntimeOrigin> for Result<Origin<Runtime>, RuntimeOrigin>
impl From<RuntimeOrigin> for Result<Origin<Runtime>, RuntimeOrigin>
source§fn from(val: RuntimeOrigin) -> Self
fn from(val: RuntimeOrigin) -> Self
NOTE: converting to pallet origin loses the origin filter information.
source§impl OriginTrait for RuntimeOrigin
impl OriginTrait for RuntimeOrigin
§type PalletsOrigin = OriginCaller
type PalletsOrigin = OriginCaller
The caller origin, overarching type of all pallets origins.
source§fn add_filter(&mut self, filter: impl Fn(&Self::Call) -> bool + 'static)
fn add_filter(&mut self, filter: impl Fn(&Self::Call) -> bool + 'static)
Add a filter to the origin.
source§fn reset_filter(&mut self)
fn reset_filter(&mut self)
Reset origin filters to default one, i.e
frame_system::1fig::BaseCallFilter
.source§fn set_caller_from(&mut self, other: impl Into<Self>)
fn set_caller_from(&mut self, other: impl Into<Self>)
Replace the caller with caller from the other origin
source§fn filter_call(&self, call: &Self::Call) -> bool
fn filter_call(&self, call: &Self::Call) -> bool
Filter the call if caller is not root, if false is returned then the call must be filtered
out. Read more
source§fn into_caller(self) -> Self::PalletsOrigin
fn into_caller(self) -> Self::PalletsOrigin
Consume
self
and return the caller.source§fn try_with_caller<R>(
self,
f: impl FnOnce(Self::PalletsOrigin) -> Result<R, Self::PalletsOrigin>
) -> Result<R, Self>
fn try_with_caller<R>( self, f: impl FnOnce(Self::PalletsOrigin) -> Result<R, Self::PalletsOrigin> ) -> Result<R, Self>
Do something with the caller, consuming self but returning it if the caller was unused.
source§fn signed(by: Self::AccountId) -> Self
fn signed(by: Self::AccountId) -> Self
Create with system signed origin and
frame_system::Config::BaseCallFilter
.§fn as_signed(self) -> Option<Self::AccountId>
fn as_signed(self) -> Option<Self::AccountId>
👎Deprecated: Use
into_signer
insteadExtract the signer from the message if it is a
Signed
origin.§fn into_signer(self) -> Option<Self::AccountId>
fn into_signer(self) -> Option<Self::AccountId>
Extract the signer from the message if it is a
Signed
origin.§fn as_system_ref(&self) -> Option<&RawOrigin<Self::AccountId>>
fn as_system_ref(&self) -> Option<&RawOrigin<Self::AccountId>>
Extract a reference to the system origin, if that’s what the caller is.
Auto Trait Implementations§
impl Freeze for RuntimeOrigin
impl !RefUnwindSafe for RuntimeOrigin
impl !Send for RuntimeOrigin
impl !Sync for RuntimeOrigin
impl Unpin for RuntimeOrigin
impl !UnwindSafe for RuntimeOrigin
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self>where
Self: TryFrom<T>,
§fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T>where
Self: TryInto<T>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> IsType<T> for T
impl<T> IsType<T> for T
§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read more§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.