pub struct RuntimeOrigin {
pub caller: OriginCaller,
/* private fields */
}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: OriginCallerImplementationsยง
Sourceยงimpl RuntimeOrigin
impl RuntimeOrigin
Sourcepub fn none() -> Self
pub fn none() -> Self
Create with system none origin and frame_system::Config::BaseCallFilter.
Sourcepub fn root() -> Self
pub fn root() -> Self
Create with system root origin and frame_system::Config::BaseCallFilter.
Trait Implementationsยง
Sourceยงimpl Clone for RuntimeOrigin
impl Clone for RuntimeOrigin
Sourceยงfn clone(&self) -> RuntimeOrigin
fn clone(&self) -> RuntimeOrigin
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) ยท 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
Available on crate feature std only.
impl Debug for RuntimeOrigin
Available on crate feature
std only.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<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
Sourceยงtype Call = <Runtime as Config>::RuntimeCall
type Call = <Runtime as Config>::RuntimeCall
Runtime call type, as in
frame_system::Config::CallSourceยง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 caller(&self) -> &Self::PalletsOrigin
fn caller(&self) -> &Self::PalletsOrigin
Get a reference to the caller (
CallerTrait impl).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.Sourceยงfn as_signed(self) -> Option<Self::AccountId>
fn as_signed(self) -> Option<Self::AccountId>
๐Deprecated:
Use into_signer instead
Extract the signer from the message if it is a
Signed origin.Sourceยง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.Auto Trait Implementationsยง
impl !RefUnwindSafe for RuntimeOrigin
impl !Send for RuntimeOrigin
impl !Sync for RuntimeOrigin
impl !UnwindSafe for RuntimeOrigin
impl Freeze for RuntimeOrigin
impl Unpin for RuntimeOrigin
impl UnsafeUnpin 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Sourceยงimpl<T> CheckedConversion for T
impl<T> CheckedConversion for T
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Sourceยงfn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Sourceยงfn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Sourceยงfn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Anyโs vtable from &Traitโs.Sourceยงfn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Anyโs vtable from &mut Traitโs.Sourceยงimpl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
Sourceยงfn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Sourceยง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 moreSourceยงimpl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
impl<T> MaybeDebug for Twhere
T: Debug,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Sourceยงimpl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
Sourceยงfn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more
Sourceยงimpl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
Sourceยงfn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
Sourceยง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 moreSourceยง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>
Sourceยงimpl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
Sourceยงfn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from.Sourceยงimpl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
Sourceยงfn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T.