Trait holochain::prelude::ActionUnweighed
source · pub trait ActionUnweighed: Sized {
type Weighed: ActionWeighed;
type Weight: Default;
// Required method
fn weighed(self, weight: Self::Weight) -> Self::Weighed;
// Provided method
fn weightless(self) -> Self::Weighed { ... }
}
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 “unweighed” version of each struct, i.e. the version with 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§
Required Methods§
Provided Methods§
sourcefn weightless(self) -> Self::Weighed
fn weightless(self) -> Self::Weighed
Add zero weight to this unweighed action, making it “weighed”.
Object Safety§
This trait is not object safe.