Trait hdi_extensions::ActionTransformer
source · pub trait ActionTransformer: Sized {
// Required method
fn summon_app_entry<ET>(&self) -> ExternResult<ET>
where ET: EntryTypesHelper,
WasmError: From<<ET as EntryTypesHelper>::Error>;
}
Expand description
Extend Action
transformations
Required Methods§
sourcefn summon_app_entry<ET>(&self) -> ExternResult<ET>
fn summon_app_entry<ET>(&self) -> ExternResult<ET>
Get the app entry that this action points to
§Example: Basic Usage
ⓘ
use hdi::prelude::*;
use hdi_extensions::*;
#[hdk_entry_helper]
struct PostEntry {
pub message: String,
}
#[hdk_entry_defs]
#[unit_enum(EntryTypesUnit)]
pub enum EntryTypes {
#[entry_def]
Post(PostEntry),
}
fn test(addr: ActionHash) -> ExternResult<()> {
let action = summon_action( &addr )?.hashed.content;
let entry_type = action.summon_app_entry<EntryTypes>()?;
Ok(())
}
Object Safety§
This trait is not object safe.