Skip to main content

WordKey

Trait WordKey 

Source
pub trait WordKey: Copy {
    // Required method
    fn try_into_word(self) -> Result<Word, &'static str>;
}
Expand description

A type that can be used as a key in a storage map.

Map keys are passed by value for lookups to avoid requiring Clone just to materialize a Word for the host call.

Required Methods§

Source

fn try_into_word(self) -> Result<Word, &'static str>

Converts the key into the single storage word passed to the host.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl WordKey for AccountId

Source§

fn try_into_word(self) -> Result<Word, &'static str>

Source§

impl WordKey for AssetAmount

Source§

fn try_into_word(self) -> Result<Word, &'static str>

Source§

impl WordKey for Felt

Source§

fn try_into_word(self) -> Result<Word, &'static str>

Source§

impl WordKey for NoteIdx

Source§

fn try_into_word(self) -> Result<Word, &'static str>

Source§

impl WordKey for NoteType

Source§

fn try_into_word(self) -> Result<Word, &'static str>

Source§

impl WordKey for Tag

Source§

fn try_into_word(self) -> Result<Word, &'static str>

Source§

impl WordKey for Word

Source§

fn try_into_word(self) -> Result<Word, &'static str>

Implementors§