pub trait OpHelper {
fn to_type<ET, LT>(&self) -> Result<OpType<ET, LT>, WasmError>
where
ET: EntryTypesHelper + UnitEnum,
LT: LinkTypesHelper,
<ET as UnitEnum>::Unit: Into<ZomeTypesKey<EntryDefIndex>>,
WasmError: From<<ET as EntryTypesHelper>::Error>,
WasmError: From<<LT as LinkTypesHelper>::Error>;
}
Expand description
This trait provides a conversion to a convenience type OpType
for use in the validation call back.
Not all data is available in the OpType
. This is why the Op
is not taken by value and can still be used after this conversion.
There is data that is common to all ops and can be accessed via helpers on the op.
- Get the
Op::author()
of the op. - Get the
Op::timestamp()
for when the op was created. - Get the
Op::action_seq()
of the op. - Get the
Op::prev_action()
of the op. - Get the
Op::action_type()
of the op.