pub trait ModuleResolver {
    type Error: Debug;

    // Required method
    fn get_module(
        &self,
        id: &ModuleId
    ) -> Result<Option<Vec<u8, Global>>, Self::Error>;
}
Expand description

Traits for resolving Move modules and resources from persistent storage A persistent storage backend that can resolve modules by address + name. 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

Required Associated Types§

type Error: Debug

Required Methods§

fn get_module( &self, id: &ModuleId ) -> Result<Option<Vec<u8, Global>>, Self::Error>

Implementations on Foreign Types§

§

impl<T> ModuleResolver for &Twhere T: ModuleResolver + ?Sized,

§

type Error = <T as ModuleResolver>::Error

§

fn get_module( &self, module_id: &ModuleId ) -> Result<Option<Vec<u8, Global>>, <&T as ModuleResolver>::Error>

Implementors§