Trait holochain::prelude::action::ActionWeighed
pub trait ActionWeighed {
type Unweighed: ActionUnweighed;
type Weight: Default;
fn into_action(self) -> Action;
fn unweighed(self) -> Self::Unweighed;
}
Expand description
A trait to unify the “inner” parts of an Action, i.e. the structs inside the Action enum’s variants. This trait is used for the “weighed” version of each struct, i.e. the version without weight information erased.
Action types with no weight are considered “weighed” and “unweighed” at the same time, but types with weight have distinct types for the weighed and unweighed versions.
Required Associated Types
type Unweighed: ActionUnweighed
type Weight: Default
Required Methods
fn into_action(self) -> Action
fn into_action(self) -> Action
Construct the full Action enum with this variant.
fn unweighed(self) -> Self::Unweighed
fn unweighed(self) -> Self::Unweighed
Erase the rate limiting weight info, creating an “unweighed” version
of this action. This is used primarily by validators who need to run the
weigh
callback on an action they received, and want to make sure their
callback is not using the predefined weight to influence the result.