pub trait LinkTypesHelper: Sized {
    type Error;

    fn from_type<Z, I>(
        zome_index: Z,
        link_type: I
    ) -> Result<Option<Self>, Self::Error>
    where
        Z: Into<ZomeIndex>,
        I: Into<LinkType>
; }
Expand description

A helper trait for finding the app defined link type from a ZomeIndex and LinkType.

If the zome id is a dependency of the calling zome and the link type is out of range (greater than the number of defined link types) then a guest error is return (which will invalidate an op if used in the validation callback).

If the zome id is not a dependency of the calling zome then this will return None.

Required Associated Types§

source

type Error

The error associated with this conversion.

Required Methods§

source

fn from_type<Z, I>(
    zome_index: Z,
    link_type: I
) -> Result<Option<Self>, Self::Error>where
    Z: Into<ZomeIndex>,
    I: Into<LinkType>,

Check if the ZomeIndex and LinkType matches one of the ZomeLinkTypeKey::from(Self::variant) and if it does return that type.

Implementations on Foreign Types§

source§

impl LinkTypesHelper for ()

§

type Error = Infallible

source§

fn from_type<Z, I>(
    _zome_index: Z,
    _link_type: I
) -> Result<Option<()>, <() as LinkTypesHelper>::Error>where
    Z: Into<ZomeIndex>,
    I: Into<LinkType>,

Implementors§