pub trait StorageAccess {
    type Storage;
    type Data;

    const STORAGE_KEY: &'static str;
}
Expand description

A trait for describing which storages an item needs access to. See StashDeviceStorageFactory::initialize for usage.

§Example


impl DeviceStorageCompatible for StorageItem {
   // ...
   const KEY: &'static str = "some_key";
}

impl StorageAccess for SomeItem {
    type Storage = DeviceStorage;
    const STORAGE_KEY: &'static str = StorageItem::KEY;
}

Required Associated Types§

Required Associated Constants§

source

const STORAGE_KEY: &'static str

This field should be populated with the key used by the corresponding storage mechanism.

Object Safety§

This trait is not object safe.

Implementors§