pub async fn new(
        saf: SafDef,
        wasm: impl IntoIterator<Item = wasm::SafWasm>,
    ) -> Result<Self, SafError> {
        let mut code = BTreeMap::new();
        for wasm in wasm {
            let wasm_hash = ai_hash::WasmHash::with_data(&wasm).await;
            code.insert(wasm_hash, wasm);
        }
        let saf = SafDefHashed::from_content_sync(saf);
        Ok(Self {
            saf,
            code: code.into(),
        })
    }
/// Construct a new SafFile instance.
Construct a new SafFile instance.
Construct a new SafFile instance .
pub async fn new(
        saf: SafDef,
        wasm: impl IntoIterator<Item = wasm::SafWasm>,
    ) -> Result<Self, SafError> {
        let mut code = BTreeMap::new();
        for wasm in wasm {
            let wasm_hash = ai_hash::WasmHash::with_data(&wasm).await;
            code.insert(wasm_hash, wasm);
        }
        let saf = SafDefHashed::from_content_sync(saf);
        Ok(Self {
            saf,
            code: code.into(),
        })
    }
pub async fn new ( saf : SafDef , wasm : impl IntoIterator < Item = wasm :: SafWasm > , ) -> Result < Self , SafError > { let mut code = BTreeMap :: new ( ) ; for wasm in wasm { let wasm_hash = ai_hash :: WasmHash :: with_data ( & wasm ) . await ; code . insert ( wasm_hash , wasm ) ; } let saf = SafDefHashed :: from_content_sync ( saf ) ; Ok ( Self { saf , code : code . into ( ) , } ) }
Construct a new SafFile instance.
Construct a new SafFile instance .
saf
SafDef
wasm
impl IntoIterator<Item = wasm::SafWasm>
saf
SafDef
wasm
impl IntoIterator<Item = wasm::SafWasm>