Trait hdk::prelude::OpHelper

source ·
pub trait OpHelper {
    // Required method
    fn flattened<ET, LT>(&self) -> Result<FlatOp<ET, LT>, WasmError>
       where ET: EntryTypesHelper + UnitEnum,
             <ET as UnitEnum>::Unit: Into<ZomeTypesKey<EntryDefIndex>>,
             LT: LinkTypesHelper,
             WasmError: From<<ET as EntryTypesHelper>::Error> + From<<LT as LinkTypesHelper>::Error>;

    // Provided method
    fn to_type<ET, LT>(&self) -> Result<FlatOp<ET, LT>, WasmError>
       where ET: EntryTypesHelper + UnitEnum,
             <ET as UnitEnum>::Unit: Into<ZomeTypesKey<EntryDefIndex>>,
             LT: LinkTypesHelper,
             WasmError: From<<ET as EntryTypesHelper>::Error> + From<<LT as LinkTypesHelper>::Error> { ... }
}
Expand description

This trait provides a conversion to a convenience type FlatOp for use in the validation call back.

Not all data is available in the FlatOp. 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.

Required Methods§

source

fn flattened<ET, LT>(&self) -> Result<FlatOp<ET, LT>, WasmError>

Converts an Op to a FlatOp without consuming it. This will clone the required internal data.

Provided Methods§

source

fn to_type<ET, LT>(&self) -> Result<FlatOp<ET, LT>, WasmError>

👎Deprecated: to_type has been renamed to flattened, please use that name instead

Alias for flattened, for backward compatibility

Object Safety§

This trait is not object safe.

Implementors§