Trait diem_sdk::move_types::resolver::ResourceResolver
pub trait ResourceResolver {
type Error: Debug;
// Required method
fn get_resource(
&self,
address: &AccountAddress,
typ: &StructTag
) -> Result<Option<Vec<u8, Global>>, Self::Error>;
}
Expand description
A persistent storage backend that can resolve resources by address + type Storage backends should return
- Ok(Some(..)) if the data exists
- Ok(None) if the data does not exist
- Err(..) only when something really wrong happens, for example - invariants are broken and observable from the storage side (this is not currently possible as ModuleId and StructTag are always structurally valid) - storage encounters internal error